本文整理汇总了PHP中Magento\Framework\View\Page\Config::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getTitle方法的具体用法?PHP Config::getTitle怎么用?PHP Config::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\View\Page\Config
的用法示例。
在下文中一共展示了Config::getTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareLayout
/**
* Golbal Prepare Layout
*
* @return $this
*/
public function _prepareLayout()
{
$this->_addBreadcrumbs();
$this->pageConfig->getTitle()->set("Blog");
$pager = $this->getLayout()->createBlock('Magento\\Theme\\Block\\Html\\Pager');
$pager->setShowPerPage("2");
$pager->setCollection($this->getPostCollection());
$this->setChild("posts.pager", $pager);
parent::_prepareLayout();
}
示例2: _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();
}
示例3: processTitle
/**
* Process title
*
* @param \Magento\Framework\View\Page\Config\Structure $pageStructure
* @return $this
*/
protected function processTitle(Structure $pageStructure)
{
if ($pageStructure->getTitle()) {
$this->pageConfig->getTitle()->set($pageStructure->getTitle());
}
return $this;
}
示例4: getTitle
/**
* {@inheritdoc}
*/
public function getTitle()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getTitle');
if (!$pluginInfo) {
return parent::getTitle();
} else {
return $this->___callPlugins('getTitle', func_get_args(), $pluginInfo);
}
}
示例5: _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();
}
示例6: renderTitle
/**
* @return string
*/
public function renderTitle()
{
return '<title>' . $this->escaper->escapeHtml($this->pageConfig->getTitle()->get()) . '</title>' . "\n";
}