Piwik\API\Request::getClassNameAPI PHP Method

getClassNameAPI() public static method

Returns the name of a plugin's API class by plugin name.
public static getClassNameAPI ( string $plugin ) : string
$plugin string The plugin name, eg, `'Referrers'`.
return string The fully qualified API class name, eg, `'\Piwik\Plugins\Referrers\API'`.
    public static function getClassNameAPI($plugin)
    {
        return sprintf('\\Piwik\\Plugins\\%s\\API', $plugin);
    }

Usage Example

 /**
  * trigger loading all plugins with an API.php file in the Proxy
  */
 public function __construct()
 {
     $plugins = \Piwik\Plugin\Manager::getInstance()->getLoadedPluginsName();
     foreach ($plugins as $plugin) {
         try {
             $className = Request::getClassNameAPI($plugin);
             Proxy::getInstance()->registerClass($className);
         } catch (Exception $e) {
         }
     }
 }
All Usage Examples Of Piwik\API\Request::getClassNameAPI