From 2.5 Migration Guide:
$title_for_layout
is deprecated. Use$this->fetch('title');
and$this->assign('title', 'your-page-title');
instead.
They work in Views, but what to do in Controller? Using $this->assign()
throws Fatal error.
Use
$this->set('title_for_layout', 'List User');
inside controller.
You have to use
$this->assign('title',$title);
in view files.
In layout, You can also use
$this->fetch('title', $title);
to set the title
You can use $this->set('title_for_layout',$title);
but you should not as it will be removed very soon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With