本文整理汇总了PHP中Magento\Framework\App\Action\Context::getObjectManager方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getObjectManager方法的具体用法?PHP Context::getObjectManager怎么用?PHP Context::getObjectManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Action\Context
的用法示例。
在下文中一共展示了Context::getObjectManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param Context $context
*/
public function __construct(Context $context)
{
parent::__construct($context->getRequest(), $context->getResponse());
$this->_objectManager = $context->getObjectManager();
$this->_eventManager = $context->getEventManager();
$this->_url = $context->getUrl();
$this->_actionFlag = $context->getActionFlag();
$this->_redirect = $context->getRedirect();
$this->_view = $context->getView();
$this->messageManager = $context->getMessageManager();
}
示例2: __construct
/**
* BxListProducts constructor.
* @param Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param CategoryRepositoryInterface $categoryRepository
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param Data $bxHelperData
* @param \Boxalino\Intelligence\Helper\P13n\Adapter $p13nHelper
* @param \Magento\Framework\App\Action\Context $actionContext
* @param \Magento\Framework\UrlFactory $urlFactory
* @param \Magento\Catalog\Helper\Category $categoryHelper
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
* @param \Magento\Catalog\Block\Category\View $categoryViewBlock
* @param \Psr\Log\LoggerInterface $logger
* @param array $data
*/
public function __construct(\Magento\Catalog\Block\Product\Context $context, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Catalog\Model\Layer\Resolver $layerResolver, CategoryRepositoryInterface $categoryRepository, \Magento\Framework\Url\Helper\Data $urlHelper, \Boxalino\Intelligence\Helper\Data $bxHelperData, \Boxalino\Intelligence\Helper\P13n\Adapter $p13nHelper, \Magento\Framework\App\Action\Context $actionContext, \Magento\Framework\UrlFactory $urlFactory, \Magento\Catalog\Helper\Category $categoryHelper, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Block\Category\View $categoryViewBlock, \Psr\Log\LoggerInterface $logger, array $data = [])
{
$this->_logger = $logger;
$this->_response = $actionContext->getResponse();
$this->categoryViewBlock = $categoryViewBlock;
$this->categoryFactory = $categoryFactory;
$this->categoryHelper = $categoryHelper;
$this->bxHelperData = $bxHelperData;
$this->p13nHelper = $p13nHelper;
$this->_url = $actionContext->getUrl();
$this->_objectManager = $actionContext->getObjectManager();
parent::__construct($context, $postDataHelper, $layerResolver, $categoryRepository, $urlHelper, $data);
}