怎样设置页面浏览器标题
一般来说,设置页面浏览器标题有两种方法:
1. 在layout文件中配置
<youmodule_yourcontroller_youraction> <reference name="root"> <action method="setHeaderTitle" translate="title" module="your_module"><title>Your Title for Browser</title></action> </reference></youmodule_yourcontroller_youraction>
public function indexAction() { $this->loadLayout(); $this->getLayout()->getBlock('head')->setTitle($this->__('Your title')); ...... $this->renderLayout(); }