本文整理汇总了PHP中Magento\Framework\View\Page\Config::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setDescription方法的具体用法?PHP Config::setDescription怎么用?PHP Config::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\View\Page\Config
的用法示例。
在下文中一共展示了Config::setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareLayout
public function _prepareLayout()
{
$brand = $this->getBrand();
$pageMainTitle = $this->getLayout()->getBlock('page.main.title');
if ($pageMainTitle) {
$pageMainTitle->setPageTitle($brand->getName());
}
$this->pageConfig->getTitle()->set($brand->getTitle());
$this->pageConfig->setKeywords($brand->getTitle());
$this->pageConfig->setDescription($brand->getTitle());
return parent::_prepareLayout();
}
示例2: _prepareLayout
/**
* Prepare global layout
*
* @return $this
*/
protected function _prepareLayout()
{
$page = $this->getPage();
$this->_addBreadcrumbs($page);
$this->pageConfig->addBodyClass('cms-' . $page->getIdentifier());
$this->pageConfig->getTitle()->set($page->getTitle());
$this->pageConfig->setKeywords($page->getMetaKeywords());
$this->pageConfig->setDescription($page->getMetaDescription());
$pageMainTitle = $this->getLayout()->getBlock('page.main.title');
if ($pageMainTitle) {
// Setting empty page title if content heading is absent
$cmsTitle = $page->getContentHeading() ?: ' ';
$pageMainTitle->setPageTitle($this->escapeHtml($cmsTitle));
}
return parent::_prepareLayout();
}
示例3: setDescription
/**
* {@inheritdoc}
*/
public function setDescription($description)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'setDescription');
if (!$pluginInfo) {
return parent::setDescription($description);
} else {
return $this->___callPlugins('setDescription', func_get_args(), $pluginInfo);
}
}