Has anyone run into this problem…
In my layout.phtml I have:
<head> <?= $this->headTitle('Control Application - ') ?> </head>
then in index.phtml I have:
<? $this->headTitle()->append('Client List'); ?>
I expect that, when I go to my index action, the title should be ‘Control Application – Client List’ but instead I have ‘Client ListControl Application – ‘
What is going on? How can I fix this?
Default behaviour of the headTitle() is to append to the stack. Before calling headTitle() in layout.phtml, your stack is:
Then, you call headTitle with the first argument and no second argument (which makes it default to APPEND), resulting in the following stack:
The solution, in layout.phtml: