Magento2 网站上每个模块的标题都错误
Magento 2为网站上的每个模块显示错误的标题,例如模块保修和付款(创建新客户帐户)。它显示标题路径vendor/magento/module theme/view/frontend/templates/html/title.phtmlMagento2 网站上每个模块的标题都错误,magento2,Magento2,Magento 2为网站上的每个模块显示错误的标题,例如模块保修和付款(创建新客户帐户)。它显示标题路径vendor/magento/module theme/view/frontend/templates/html/title.phtml 如何解决此问题?修复了在自定义模块中设置标题的问题,例如在\Vendor\Module\Controller\Index中 /** * @var \Magento\Framework\View\Result\PageFactory */ protecte
如何解决此问题?修复了在自定义模块中设置标题的问题,例如在\Vendor\Module\Controller\Index中
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $_resultPageFactory;
/**
* @param Context $context,
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory,
*/
public function __construct(Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
{
$this->_resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
/**
* return page factory
*/
public function execute()
{
$resultPage = $this->_resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('My Module Title'));
return $resultPage;
}
检查您是否没有将块添加到从Magento\Sales\block\Order\History块扩展的客户区域的扩展。此块设置构造函数中的页面标题。我已经看到了一个扩展,它可以做到这一点,几个帐户部分的页面标题是“我的订单”