How to set page titles in Zend Framework

  • SumoMe

Welcome, today I will show you how to set page title on page in Zend Framework.
In Zend Framework, you can set the page title in the controller, like in the example below:

<?php
class Panel_TestsController extends Zend_Controller_Action
{
  public function testAction() {
    //  setting the page title
    $this->_helper->layout()->getView()->headTitle('View all students');
  }
}

or in the view:

/**
 * views/scripts/tests/index.phtml
 */
$this->headTitle('View all students');

And that’s all. Good luck

3 thoughts on “How to set page titles in Zend Framework”

Leave a Reply


*