Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the title_for_layout in the default PagesController?

I cannot set title_for_layout in the PagesController that comes by default with CakePHP 1.3.

I am using the following code in the display function:

$this->set('title_for_layout','some title');

What am I doing wrong?

like image 550
ion Avatar asked Apr 13 '10 11:04

ion


1 Answers

In your controller, the corresponding value is $this->pageTitle.

UPDATE

Oops, as noted in the comments, this is the 1.2 solution. 1.3 possibilities (after doing some research) include:

  1. Ensuring that $title_for_layout is being echoed in the layout
  2. Placing the $this->set() code in the view rather than in the controller
like image 156
Rob Wilkerson Avatar answered Oct 11 '22 22:10

Rob Wilkerson