本文整理汇总了PHP中org_glizy_ObjectFactory::attachPageToComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::attachPageToComponent方法的具体用法?PHP org_glizy_ObjectFactory::attachPageToComponent怎么用?PHP org_glizy_ObjectFactory::attachPageToComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org_glizy_ObjectFactory
的用法示例。
在下文中一共展示了org_glizy_ObjectFactory::attachPageToComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
if ($this->getAttribute('global')) {
$templateXml = 'TemplateAdminGlobal';
$menuId = 0;
} else {
$templateXml = 'TemplateAdmin';
$menuId = __Request::get('menuId', __Request::get('__id'));
if (!$menuId) {
// TODO ERRORE
}
}
$templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
$templateName = $templateProxy->getSelectedTemplate();
if (!$templateName) {
// TODO ERRORE
}
$templateProxy->loadTemplateLocale();
// legge i dati del template
$data = $templateProxy->getEditDataForMenu($menuId, __Request::exists('loadFromParent'));
$customTemplate = $templateProxy->getTemplateCustomClass();
if ($customTemplate && method_exists($customTemplate, 'updateTemplateData')) {
$customTemplate->updateTemplateData($data);
}
$this->setData($data);
$this->addDefaultComponents();
$templateRealPath = $templateProxy->getTemplateRealpath();
if ($templateRealPath) {
org_glizy_ObjectFactory::attachPageToComponent($this, $this->_application, $templateXml, $templateRealPath . '/', array('idPrefix' => $this->getId() . '-', 'skipImport' => true, 'mode' => 'edit'), $this->getId() . '-');
parent::process();
// TODO visualizzare che non ci sono parametri di personalizzazione
}
}
示例2: loadTemplate
protected function loadTemplate()
{
if (__Config::get('glizycms.contents.templateEnabled')) {
$templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
$templateName = $templateProxy->getSelectedTemplate();
$templatePath = $templateProxy->getTemplateRealpath();
$this->templateData = $templateProxy->getDataForMenu($this->_application->getPageId());
// if is defined a custom XML file read and attach to component DOM
if (file_exists($templatePath . '/Template.xml')) {
org_glizy_ObjectFactory::attachPageToComponent($this, $this->_application, 'Template', $templateProxy->getTemplateRealpath(), array(), $this->selfId . '-', false);
}
// check if there is a templateFileName override
if (property_exists($this->templateData, 'templateFileName') && $this->templateData->templateFileName != 'default') {
$this->setAttribute('templateFileName', $this->templateData->templateFileName);
}
$this->customTemplate = $templateProxy->getTemplateCustomClass();
if (is_object($this->customTemplate) && method_exists($this->customTemplate, 'process')) {
$this->customTemplate->process($this->_application, $this, $this->templateData);
}
}
}