当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::getConfig方法代码示例

本文整理汇总了PHP中Magento\Framework\View\Result\Page::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::getConfig方法的具体用法?PHP Page::getConfig怎么用?PHP Page::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\View\Result\Page的用法示例。


在下文中一共展示了Page::getConfig方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getConfig

 /**
  * {@inheritdoc}
  */
 public function getConfig()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getConfig');
     if (!$pluginInfo) {
         return parent::getConfig();
     } else {
         return $this->___callPlugins('getConfig', func_get_args(), $pluginInfo);
     }
 }
开发者ID:HaonanXu,项目名称:der-snack-backup,代码行数:12,代码来源:Interceptor.php

示例2: initResultPage

 protected function initResultPage()
 {
     if (!is_null($this->resultPage)) {
         return;
     }
     $this->resultPage = $this->resultPageFactory->create();
     $this->resultPage->addHandle($this->getLayoutType());
     $this->resultPage->getConfig()->getTitle()->set($this->__('M2ePro'));
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:9,代码来源:Base.php

示例3: initProductLayout

 /**
  * Init layout for viewing product page
  *
  * @param \Magento\Framework\View\Result\Page $resultPage
  * @param \Magento\Catalog\Model\Product $product
  * @param null|\Magento\Framework\Object $params
  * @return \Magento\Catalog\Helper\Product\View
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function initProductLayout(ResultPage $resultPage, $product, $params = null)
 {
     $settings = $this->_catalogDesign->getDesignSettings($product);
     $pageConfig = $resultPage->getConfig();
     if ($settings->getCustomDesign()) {
         $this->_catalogDesign->applyCustomDesign($settings->getCustomDesign());
     }
     // Apply custom page layout
     if ($settings->getPageLayout()) {
         $pageConfig->setPageLayout($settings->getPageLayout());
     }
     $urlSafeSku = rawurlencode($product->getSku());
     // Load default page handles and page configurations
     if ($params && $params->getBeforeHandles()) {
         foreach ($params->getBeforeHandles() as $handle) {
             $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()], $handle);
         }
     }
     $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()]);
     if ($params && $params->getAfterHandles()) {
         foreach ($params->getAfterHandles() as $handle) {
             $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()], $handle);
         }
     }
     // Apply custom layout update once layout is loaded
     $update = $resultPage->getLayout()->getUpdate();
     $layoutUpdates = $settings->getLayoutUpdates();
     if ($layoutUpdates) {
         if (is_array($layoutUpdates)) {
             foreach ($layoutUpdates as $layoutUpdate) {
                 $update->addUpdate($layoutUpdate);
             }
         }
     }
     $currentCategory = $this->_coreRegistry->registry('current_category');
     $controllerClass = $this->_request->getFullActionName();
     if ($controllerClass != 'catalog-product-view') {
         $pageConfig->addBodyClass('catalog-product-view');
     }
     $pageConfig->addBodyClass('product-' . $product->getUrlKey());
     if ($currentCategory instanceof \Magento\Catalog\Model\Category) {
         $pageConfig->addBodyClass('categorypath-' . $this->categoryUrlPathGenerator->getUrlPath($currentCategory))->addBodyClass('category-' . $currentCategory->getUrlKey());
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:55,代码来源:View.php

示例4: setLayoutType

 /**
  * Set layout type
  *
  * @param bool $inRange
  * @param \Magento\Framework\View\Result\Page $resultPage
  * @return \Magento\Framework\View\Result\Page
  */
 protected function setLayoutType($inRange, $resultPage)
 {
     if ($this->_page->getPageLayout()) {
         if ($this->_page->getCustomPageLayout() && $this->_page->getCustomPageLayout() != 'empty' && $inRange) {
             $handle = $this->_page->getCustomPageLayout();
         } else {
             $handle = $this->_page->getPageLayout();
         }
         $resultPage->getConfig()->setPageLayout($handle);
     }
     return $resultPage;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:Page.php

示例5: generateLayoutBlocks

 /**
  * Generate layout blocks
  *
  * @return $this
  */
 public function generateLayoutBlocks()
 {
     $this->page->getConfig()->publicBuild();
     return $this;
 }
开发者ID:IlyaGluschenko,项目名称:test001,代码行数:10,代码来源:View.php

示例6: testGetConfig

 public function testGetConfig()
 {
     $this->assertEquals($this->pageConfig, $this->page->getConfig());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:4,代码来源:PageTest.php


注:本文中的Magento\Framework\View\Result\Page::getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。