views:

194

answers:

1

I need to dynamically generate title and meta tags in my application. So I need to get response object (f.e. like in symfony framework) and set corresponding data in section. How can I do this in Yii?

+2  A: 

To modify page title, set CController::pageTitle either in your action or your view.

$this->pageTitle = '...';

As long as your main layout echoes this inbetween title tags, it works very well. (This is done by default.)

To add other headers, use

Yii::app()->clientScript->registerMetaTag($content, $name, $httpEquiv, $options);

Please refer to the API for explanation of this signature.

pestaa