Showing posts with label php default value of title block set to controller name in cakePHP?. Show all posts
Showing posts with label php default value of title block set to controller name in cakePHP?. Show all posts

default value of title block set to controller name in cakePHP?

Wednesday, November 4, 2015

In a cakephp layout I fetch a block in order to set the title of the page like so



<title>Example - <?php echo $this->fetch('title');?></title>


I have noticed that unless I create a block 'title' in a view or assign some value to the block, the value of title always corresponds to the name of the controller. I have not found this behaviour documented anywhere. Is there any way to change this? My cakePHP version is 2.7.5.

default value of title block set to controller name in cakePHP?

In a cakephp layout I fetch a block in order to set the title of the page like so



<title>Example - <?php echo $this->fetch('title');?></title>


I have noticed that unless I create a block 'title' in a view or assign some value to the block, the value of title always corresponds to the name of the controller. I have not found this behaviour documented anywhere. Is there any way to change this? My cakePHP version is 2.7.5.