soukupj
(Info)
1
How can I solve global prefix for the page Title?
Would it have an automatic from main.php in view only set TITLE.
Something ala before render or something …
main.php
..
'params' => array(
'prefixPageTitle'=> 'My Application - ',
..
/view/account/index.php
$this->pageTitle = 'My Account';
I do not use
$this->pageTitle = Yii::app()->params['prefixPageTitle'].'My Account';
result: My Application - My Account
how-to ?
thank you
abennouna
(Abennouna)
2
Hi,
You could define it in your protected/components/Controller.php for instance. I don’t know if it’s the best approach, but that’s what I do.
How about just put the prefix in your layout file? Either directly:
<title><?php echo CHtml::encode('My app - ' . $this->pageTitle); ?></title>
or using your parameter:
<title><?php echo CHtml::encode(Yii::app()->params['prefixPageTitle'] . $this->pageTitle); ?></title>