本文整理汇总了PHP中SkinTemplate::prepareQuickTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP SkinTemplate::prepareQuickTemplate方法的具体用法?PHP SkinTemplate::prepareQuickTemplate怎么用?PHP SkinTemplate::prepareQuickTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkinTemplate
的用法示例。
在下文中一共展示了SkinTemplate::prepareQuickTemplate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareQuickTemplate
/**
* initialize various variables and generate the template
* @return QuickTemplate
*/
protected function prepareQuickTemplate()
{
$appleTouchIcon = $this->getConfig()->get('AppleTouchIcon');
$out = $this->getOutput();
// add head items
if ($appleTouchIcon !== false) {
$out->addLink(array('rel' => 'apple-touch-icon', 'href' => $appleTouchIcon));
}
$out->addMeta('viewport', 'initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, ' . 'maximum-scale=5.0, width=device-width');
// Generate skin template
$tpl = parent::prepareQuickTemplate();
// Set whether or not the page content should be wrapped in div.content (for
// example, on a special page)
$tpl->set('unstyledContent', $out->getProperty('unstyledContent'));
// Set the links for the main menu
$tpl->set('menu_data', $this->getMenuData());
// Set the links for page secondary actions
$tpl->set('secondary_actions', $this->getSecondaryActions($tpl));
// Construct various Minerva-specific interface elements
$this->preparePageContent($tpl);
$this->prepareHeaderAndFooter($tpl);
$this->prepareMenuButton($tpl);
$this->prepareBanners($tpl);
$this->prepareWarnings($tpl);
$this->preparePageActions($tpl);
$this->prepareUserButton($tpl);
$this->prepareLanguages($tpl);
return $tpl;
}
示例2: prepareQuickTemplate
/**
* initialize various variables and generate the template
* @return QuickTemplate
*/
protected function prepareQuickTemplate()
{
$appleTouchIcon = $this->getConfig()->get('AppleTouchIcon');
$out = $this->getOutput();
// add head items
if ($appleTouchIcon !== false) {
$out->addHeadItem('touchicon', Html::element('link', array('rel' => 'apple-touch-icon', 'href' => $appleTouchIcon)));
}
$out->addHeadItem('viewport', Html::element('meta', array('name' => 'viewport', 'content' => 'initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, ' . 'maximum-scale=5.0, width=device-width')));
// Generate skin template
$tpl = parent::prepareQuickTemplate();
// Set whether or not the page content should be wrapped in div.content (for
// example, on a special page)
$tpl->set('unstyledContent', $out->getProperty('unstyledContent'));
// Set the links for the main menu
$tpl->set('menu_data', $this->getMenuData());
// Set the links for page secondary actions
$tpl->set('secondary_actions', $this->getSecondaryActions($tpl));
// Construct various Minerva-specific interface elements
$this->preparePageContent($tpl);
$this->prepareHeaderAndFooter($tpl);
$this->prepareMenuButton($tpl);
$this->prepareBanners($tpl);
$this->prepareWarnings($tpl);
$this->preparePageActions($tpl);
$this->prepareUserButton($tpl);
$this->prepareLanguages($tpl);
if ($this->isMenuEnabled) {
$templateParser = new TemplateParser(__DIR__ . '/../../resources/skins.minerva.scripts/');
$tpl->set('menuhtml', $templateParser->processTemplate('menu', $tpl->data['menu_data']));
} else {
$tpl->set('menuhtml', '');
}
return $tpl;
}
示例3: prepareQuickTemplate
/**
* initialize various variables and generate the template
* @return QuickTemplate
*/
protected function prepareQuickTemplate()
{
$appleTouchIcon = $this->getConfig()->get('AppleTouchIcon');
$out = $this->getOutput();
// add head items
if ($appleTouchIcon !== false) {
$out->addHeadItem('touchicon', Html::element('link', array('rel' => 'apple-touch-icon', 'href' => $appleTouchIcon)));
}
$out->addHeadItem('viewport', Html::element('meta', array('name' => 'viewport', 'content' => 'initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, ' . 'maximum-scale=5.0, width=device-width')));
if ($this->isMobileMode) {
// Customize page content for mobile view, e.g. add togglable sections, filter
// out various elements.
// We do this before executing parent::prepareQuickTemplate() since the parent
// overwrites $out->mBodytext, adding an mw-content-text div which is
// redundant to our own content div. By defining the bodytext HTML before
// $out->mBodytext is overwritten, we avoid including the mw-content-text div.
// FIXME: Git rid of our content div and consolidate this line with the other
// isMobileMode lines below. This will bring us more in line with core DOM.
$html = ExtMobileFrontend::DOMParse($out);
}
// Generate skin template
$tpl = parent::prepareQuickTemplate();
// Set whether or not the page content should be wrapped in div.content (for
// example, on a special page)
$tpl->set('unstyledContent', $out->getProperty('unstyledContent'));
// Set the links for the main menu
$tpl->set('menu_data', $this->getMenuData());
// Set the links for page secondary actions
$tpl->set('secondary_actions', $this->getSecondaryActions($tpl));
// Construct various Minerva-specific interface elements
$this->preparePageContent($tpl);
$this->prepareHeaderAndFooter($tpl);
$this->prepareMenuButton($tpl);
$this->prepareBanners($tpl);
$this->prepareWarnings($tpl);
$this->preparePageActions($tpl);
$this->prepareUserButton($tpl);
$this->prepareLanguages($tpl);
// Perform a few extra changes if we are in mobile mode
if ($this->isMobileMode) {
// Set our own bodytext that has been filtered by MobileFormatter
$tpl->set('bodytext', $html);
// Construct mobile-friendly footer
$this->prepareMobileFooterLinks($tpl);
}
return $tpl;
}