I am using CakePHP 3.0 and I am using inside the Cell/Header directory a display for the header. display.ctp
<?php echo (isset($pageTitle)) ? $pageTitle : 'Test'?>This code snippet runs perfectly and on every page. I am trying to set the $pageTitle dynamically. This means that I am trying to set it for every page differently. I have set inside the UsersController.php
In index method. But when I go to the url /users/index , this page title stays ‘test’. I have also tried to assign the value inside the Template/Users/index.ctp
<?= $this->assign('pageTitle', __('Users')); ?>
But it won’t work. What am I doing wrong ? Could you maybe point me in the right direction, where should I look ?