當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Shop::init方法代碼示例

本文整理匯總了PHP中Shop::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shop::init方法的具體用法?PHP Shop::init怎麽用?PHP Shop::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Shop的用法示例。


在下文中一共展示了Shop::init方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
     }
 }
開發者ID:nahakiole,項目名稱:cloudrexx,代碼行數:20,代碼來源:ComponentController.class.php

示例2: isTableAssociated

 /**
  * Check if given table is associated to shop
  *
  * @param string $table
  * @return bool
  */
 public static function isTableAssociated($table)
 {
     if (!Shop::$initialized) {
         Shop::init();
     }
     return isset(Shop::$asso_tables[$table]) && Shop::$asso_tables[$table]['type'] == 'shop';
 }
開發者ID:gks-stage,項目名稱:prestashop,代碼行數:13,代碼來源:Shop.php

示例3: 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;
     }
 }
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:27,代碼來源:ComponentController.class.php


注:本文中的Shop::init方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。