本文整理汇总了PHP中Shop::setNavbar方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::setNavbar方法的具体用法?PHP Shop::setNavbar怎么用?PHP Shop::setNavbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::setNavbar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postContentLoad
/**
* Do something after content is loaded from DB
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
// Show the Shop navbar in the Shop, or on every page if configured to do so
if (!Shop::isInitialized()) {
\Cx\Core\Setting\Controller\Setting::init('Shop', 'config');
if (\Cx\Core\Setting\Controller\Setting::getValue('shopnavbar_on_all_pages', 'Shop')) {
Shop::init();
Shop::setNavbar();
}
}
break;
}
}
示例2: postContentLoad
/**
* Do something after content is loaded from DB
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
// Show the Shop navbar in the Shop, or on every page if configured to do so
if (!Shop::isInitialized()) {
\Cx\Core\Setting\Controller\Setting::init('Shop', 'config');
if (\Cx\Core\Setting\Controller\Setting::getValue('shopnavbar_on_all_pages', 'Shop')) {
Shop::init();
Shop::setNavbar();
}
// replace global product blocks
$page->setContent(preg_replace_callback('/<!--\\s+BEGIN\\s+(block_shop_products_category_(?:\\d+)\\s+-->).*<!--\\s+END\\s+\\1/s', function ($matches) {
$blockTemplate = new \Cx\Core\Html\Sigma();
$blockTemplate->setTemplate($matches[0]);
Shop::parse_products_blocks($blockTemplate);
return $blockTemplate->get();
}, $page->getContent()));
}
break;
}
}