本文整理汇总了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);
}
}
示例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'));
}
示例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;
}
示例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;
}
示例5: generateLayoutBlocks
/**
* Generate layout blocks
*
* @return $this
*/
public function generateLayoutBlocks()
{
$this->page->getConfig()->publicBuild();
return $this;
}
示例6: testGetConfig
public function testGetConfig()
{
$this->assertEquals($this->pageConfig, $this->page->getConfig());
}