File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -354,27 +354,15 @@ JavaScript and CSS files from views.
354354
355355The ``content `` block contains the contents of the rendered view.
356356
357- ``$title_for_layout `` contains the page title. This variable is generated automatically,
358- but you can override it by setting it in your controller/view.
357+ ``$title_for_layout `` contains the page title. This variable is generated
358+ automatically, but you can override it by setting it in your controller/view as
359+ you would any other view variable.
359360
360361.. note ::
361362
362363 The ``$title_for_layout `` is deprecated as of 2.5, use ``$this->fetch('title') ``
363364 in your layout and ``$this->assign('title', 'page title') `` instead.
364365
365- Setting the title for the layout is easiest to do in the
366- controller, setting the ``$title_for_layout `` variable::
367-
368- class UsersController extends AppController {
369- public function view_active() {
370- $this->set('title_for_layout', 'View Active Users');
371- }
372- }
373-
374- You can also set the title_for_layout variable from inside the view file::
375-
376- $this->set('title_for_layout', $titleContent);
377-
378366You can create as many layouts as you wish: just place them in the
379367``app/View/Layouts `` directory, and switch between them inside of your
380368controller actions using the controller or view's
You can’t perform that action at this time.
0 commit comments