Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在magento中获取页面标题的任何方式...我有一个脚本活人..在此我需要当前页面标题..那么任何人都可以告诉我如何获得当前页面标题吗?
使用此代码
$this->getLayout()->getBlock('head')->getTitle();
您可以在您的 phtml 文件中使用此代码
要获取不带前缀(站点名称)的标题:
<?php echo str_replace(Mage::getStoreConfig('design/head/title_prefix'), '', $this->getLayout()->getBlock('head')->getTitle()); ?>