ZF\Apigility\Admin\Model\ModulePathSpec::getModulePath PHP Method

getModulePath() public method

Returns the path for the module name that is specified.
public getModulePath ( string $moduleName ) : string
$moduleName string
return string
    public function getModulePath($moduleName)
    {
        // see if we can get the path from ModuleUtils, if module isn't set will throw exception
        try {
            $modulePath = $this->modules->getModulePath($moduleName);
        } catch (\Exception $e) {
            $modulePath = sprintf($this->modulePathSpec, $this->applicationPath, $moduleName);
        }
        return $this->normalizePath($modulePath);
    }

Usage Example

示例#1
0
 /**
  * @param  ModuleEntity $moduleEntity
  * @param  ModuleUtils $modules
  * @param  ConfigResource $config
  */
 public function __construct(ModuleEntity $moduleEntity, ModulePathSpec $modules, ConfigResource $config)
 {
     $this->module         = $moduleEntity->getName();
     $this->moduleEntity   = $moduleEntity;
     $this->modules        = $modules;
     $this->configResource = $config;
     $this->modulePath     = $modules->getModulePath($this->module);
 }
All Usage Examples Of ZF\Apigility\Admin\Model\ModulePathSpec::getModulePath