本文整理匯總了PHP中XenForo_Template_Compiler::removeTemplateFromCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Template_Compiler::removeTemplateFromCache方法的具體用法?PHP XenForo_Template_Compiler::removeTemplateFromCache怎麽用?PHP XenForo_Template_Compiler::removeTemplateFromCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Template_Compiler
的用法示例。
在下文中一共展示了XenForo_Template_Compiler::removeTemplateFromCache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _postSave
/**
* Post-save handler.
*/
protected function _postSave()
{
$templateModel = $this->_getTemplateModel();
if ($this->isUpdate() && $this->isChanged('template')) {
$this->_db->insert('xf_template_history', array('title' => $this->get('title'), 'style_id' => $this->get('style_id'), 'template' => $this->getExisting('template'), 'edit_date' => $this->getExisting('last_edit_date'), 'log_date' => XenForo_Application::$time));
}
if (is_array($this->_modificationStatuses)) {
$this->_getModificationModel()->updateTemplateModificationLog($this->get('template_id'), $this->_modificationStatuses);
}
if ($this->getOption(self::OPTION_REBUILD_TEMPLATE_MAP)) {
if ($this->isChanged('title')) {
$templateModel->buildTemplateMap($this->get('title'));
if ($existingTitle = $this->getExisting('title')) {
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
// need to recompile anything including this template
$mappedTemplates = $templateModel->getMappedTemplatesByTemplateId($this->get('template_id'));
$mappedTemplateIds = array();
foreach ($mappedTemplates as $mappedTemplate) {
$mappedTemplateIds[] = $mappedTemplate['template_map_id'];
}
$templateModel->buildTemplateMap($existingTitle);
$templateModel->compileMappedTemplatesInStyleTree($templateModel->getIncludingTemplateMapIds($mappedTemplateIds));
} else {
$templateModel->buildTemplateMap($existingTitle);
}
}
} else {
if ($this->isChanged('style_id')) {
$templateModel->buildTemplateMap($this->get('title'));
}
}
}
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
XenForo_Template_Compiler::removeTemplateFromCache($this->get('title'));
XenForo_Template_Compiler::removeTemplateFromCache($this->getExisting('title'));
$this->_recompileTemplate();
$this->getModelFromCache('XenForo_Model_Style')->updateAllStylesLastModifiedDate();
$this->getModelFromCache('XenForo_Model_AdminTemplate')->updateAdminStyleLastModifiedDate();
}
if ($devDir = $this->_getDevOutputDir()) {
$this->_writeDevFileOutput($devDir);
}
}
示例2: _postSave
/**
* Post-save handler.
*/
protected function _postSave()
{
$templateModel = $this->_getTemplateModel();
if ($this->getOption(self::OPTION_REBUILD_TEMPLATE_MAP)) {
if ($this->isChanged('title')) {
$templateModel->buildTemplateMap($this->get('title'));
if ($existingTitle = $this->getExisting('title')) {
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
// need to recompile anything including this template
$mappedTemplates = $templateModel->getMappedTemplatesByTemplateId($this->get('template_id'));
$mappedTemplateIds = array();
foreach ($mappedTemplates as $mappedTemplate) {
$mappedTemplateIds[] = $mappedTemplate['template_map_id'];
}
$templateModel->buildTemplateMap($existingTitle);
$templateModel->compileMappedTemplatesInStyleTree($templateModel->getIncludingTemplateMapIds($mappedTemplateIds));
} else {
$templateModel->buildTemplateMap($existingTitle);
}
}
} else {
if ($this->isChanged('style_id')) {
$templateModel->buildTemplateMap($this->get('title'));
}
}
}
if ($this->getOption(self::OPTION_FULL_COMPILE)) {
XenForo_Template_Compiler::removeTemplateFromCache($this->get('title'));
XenForo_Template_Compiler::removeTemplateFromCache($this->getExisting('title'));
$this->_recompileTemplate();
$this->getModelFromCache('XenForo_Model_Style')->updateAllStylesLastModifiedDate();
}
if ($devDir = $this->_getDevOutputDir()) {
$this->_writeDevFileOutput($devDir);
}
}