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


PHP ManagerInterface::getDefaultGroup方法代码示例

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


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

示例1: execute

 /**
  * Update items stock status and low stock date.
  *
  * @param Observer $observer
  * @return void
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function execute(Observer $observer)
 {
     if ($this->config->isNewRelicEnabled()) {
         if (!$this->newRelicWrapper->isExtensionInstalled()) {
             $this->config->disableModule();
             $this->messageManager->addError(__('The New Relic integration requires the newrelic-php5 agent, which is not installed. More 
                     information on installing the agent is available <a target="_blank" href="%1">here</a>.', 'https://docs.newrelic.com/docs/agents/php-agent/installation/php-agent-installation-overview'), $this->messageManager->getDefaultGroup());
         }
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:CheckConfig.php

示例2: _prepareLayout

 /**
  * Preparing global layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $this->addStorageType($this->messageManager->getDefaultGroup());
     $this->addMessages($this->messageManager->getMessages(true));
     parent::_prepareLayout();
     return $this;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:12,代码来源:Messages.php

示例3: _renderPage

 /**
  * Renders CMS page
  *
  * @param Action $action
  * @param int $pageId
  * @param bool $renderLayout
  * @return bool
  */
 protected function _renderPage(Action $action, $pageId = null, $renderLayout = true)
 {
     if (!is_null($pageId) && $pageId !== $this->_page->getId()) {
         $delimiterPosition = strrpos($pageId, '|');
         if ($delimiterPosition) {
             $pageId = substr($pageId, 0, $delimiterPosition);
         }
         $this->_page->setStoreId($this->_storeManager->getStore()->getId());
         if (!$this->_page->load($pageId)) {
             return false;
         }
     }
     if (!$this->_page->getId()) {
         return false;
     }
     $inRange = $this->_localeDate->isScopeDateInInterval(null, $this->_page->getCustomThemeFrom(), $this->_page->getCustomThemeTo());
     if ($this->_page->getCustomTheme()) {
         if ($inRange) {
             $this->_design->setDesignTheme($this->_page->getCustomTheme());
         }
     }
     $this->_view->getLayout()->getUpdate()->addHandle('default')->addHandle('cms_page_view');
     $this->_view->addPageLayoutHandles(array('id' => $this->_page->getIdentifier()));
     $this->_view->addActionLayoutHandles();
     if ($this->_page->getRootTemplate()) {
         if ($this->_page->getCustomRootTemplate() && $this->_page->getCustomRootTemplate() != 'empty' && $inRange) {
             $handle = $this->_page->getCustomRootTemplate();
         } else {
             $handle = $this->_page->getRootTemplate();
         }
         $this->_pageLayout->applyHandle($handle);
     }
     $this->_eventManager->dispatch('cms_page_render', array('page' => $this->_page, 'controller_action' => $action));
     $this->_view->loadLayoutUpdates();
     if ($this->_page->getCustomLayoutUpdateXml() && $inRange) {
         $layoutUpdate = $this->_page->getCustomLayoutUpdateXml();
     } else {
         $layoutUpdate = $this->_page->getLayoutUpdateXml();
     }
     if (!empty($layoutUpdate)) {
         $this->_view->getLayout()->getUpdate()->addUpdate($layoutUpdate);
     }
     $this->_view->generateLayoutXml()->generateLayoutBlocks();
     $contentHeadingBlock = $this->_view->getLayout()->getBlock('page_content_heading');
     if ($contentHeadingBlock) {
         $contentHeading = $this->_escaper->escapeHtml($this->_page->getContentHeading());
         $contentHeadingBlock->setContentHeading($contentHeading);
     }
     if ($this->_page->getRootTemplate()) {
         $this->_pageLayout->applyTemplate($this->_page->getRootTemplate());
     }
     /* @TODO: Move catalog and checkout storage types to appropriate modules */
     $messageBlock = $this->_view->getLayout()->getMessagesBlock();
     $messageBlock->addStorageType($this->messageManager->getDefaultGroup());
     $messageBlock->addMessages($this->messageManager->getMessages(true));
     if ($renderLayout) {
         $this->_view->renderLayout();
     }
     return true;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:68,代码来源:Page.php

示例4: prepareResultPage

 /**
  * Return result CMS page
  *
  * @param Action $action
  * @param null $pageId
  * @return \Magento\Framework\View\Result\Page|bool
  */
 public function prepareResultPage(Action $action, $pageId = null)
 {
     if ($pageId !== null && $pageId !== $this->_page->getId()) {
         $delimiterPosition = strrpos($pageId, '|');
         if ($delimiterPosition) {
             $pageId = substr($pageId, 0, $delimiterPosition);
         }
         $this->_page->setStoreId($this->_storeManager->getStore()->getId());
         if (!$this->_page->load($pageId)) {
             return false;
         }
     }
     if (!$this->_page->getId()) {
         return false;
     }
     $inRange = $this->_localeDate->isScopeDateInInterval(null, $this->_page->getCustomThemeFrom(), $this->_page->getCustomThemeTo());
     if ($this->_page->getCustomTheme()) {
         if ($inRange) {
             $this->_design->setDesignTheme($this->_page->getCustomTheme());
         }
     }
     /** @var \Magento\Framework\View\Result\Page $resultPage */
     $resultPage = $this->resultPageFactory->create();
     $this->setLayoutType($inRange, $resultPage);
     $resultPage->addHandle('cms_page_view');
     $resultPage->addPageLayoutHandles(['id' => $this->_page->getIdentifier()]);
     $this->_eventManager->dispatch('cms_page_render', ['page' => $this->_page, 'controller_action' => $action]);
     if ($this->_page->getCustomLayoutUpdateXml() && $inRange) {
         $layoutUpdate = $this->_page->getCustomLayoutUpdateXml();
     } else {
         $layoutUpdate = $this->_page->getLayoutUpdateXml();
     }
     if (!empty($layoutUpdate)) {
         $resultPage->getLayout()->getUpdate()->addUpdate($layoutUpdate);
     }
     $contentHeadingBlock = $resultPage->getLayout()->getBlock('page_content_heading');
     if ($contentHeadingBlock) {
         $contentHeading = $this->_escaper->escapeHtml($this->_page->getContentHeading());
         $contentHeadingBlock->setContentHeading($contentHeading);
     }
     /* @TODO: Move catalog and checkout storage types to appropriate modules */
     $messageBlock = $resultPage->getLayout()->getMessagesBlock();
     $messageBlock->addStorageType($this->messageManager->getDefaultGroup());
     $messageBlock->addMessages($this->messageManager->getMessages(true));
     return $resultPage;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:53,代码来源:Page.php

示例5: _prepareMessageGroup

 /**
  * Validate message groups
  *
  * @param array $messageGroups
  * @return array
  */
 protected function _prepareMessageGroup($messageGroups)
 {
     if (!is_array($messageGroups)) {
         $messageGroups = [$messageGroups];
     } elseif (empty($messageGroups)) {
         $messageGroups[] = $this->messageManager->getDefaultGroup();
     }
     return $messageGroups;
 }
开发者ID:opexsw,项目名称:magento2,代码行数:15,代码来源:Layout.php


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