本文整理匯總了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);
}
}