本文整理汇总了PHP中Cx\Core\Core\Controller\Cx::getClassLoader方法的典型用法代码示例。如果您正苦于以下问题:PHP Cx::getClassLoader方法的具体用法?PHP Cx::getClassLoader怎么用?PHP Cx::getClassLoader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cx\Core\Core\Controller\Cx
的用法示例。
在下文中一共展示了Cx::getClassLoader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getComponentControllerClassFor
/**
* Returns class name to use for decoration
*
* If the component does not have a class named "ComponentController"
* the default SystemComponentController class is used
* @param \Cx\Core\Core\Model\Entity\SystemComponent $component Component to get decoration class for
* @return string Full qualified class name
*/
protected function getComponentControllerClassFor(\Cx\Core\Core\Model\Entity\SystemComponent $component)
{
if (!$this->cx->getClassLoader()->getFilePath($component->getDirectory(false) . '/Controller/ComponentController.class.php')) {
return '\\Cx\\Core\\Core\\Model\\Entity\\SystemComponentController';
}
$className = $component->getNamespace() . '\\Controller\\ComponentController';
return $className;
}
示例2: setPreLoadedComponents
/**
* Loads the systemComponent using the doctrine entity manager for the existing SystemComponentController and adds it to the repository
* @param array $preLoadedComponents An array containing the preloaded components
*/
public function setPreLoadedComponents($preLoadedComponents)
{
foreach ($preLoadedComponents as $componentName => $preLoadedComponent) {
// get systemComponent by name
$systemComponent = parent::findOneBy(array('name' => $componentName));
// set systemComponent on existing systemComponentController
$preLoadedComponent->setSystemComponent($systemComponent);
// add yaml directory
$yamlDir = $this->cx->getClassLoader()->getFilePath($preLoadedComponent->getDirectory(false) . '/Model/Yaml');
if (file_exists($yamlDir)) {
$this->cx->getDb()->addSchemaFileDirectories(array($yamlDir));
}
// store the systemComponent with its now loaded id as key to the array of loaded components
$this->loadedComponents[$preLoadedComponent->getId()] = $preLoadedComponent;
// Add JSON adapter
\Cx\Core\Json\JsonData::addAdapter($preLoadedComponent->getControllersAccessableByJson(), $preLoadedComponent->getNamespace() . '\\Controller');
}
}