本文整理匯總了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');
}
}