Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Title is not appearing

Hi, I have a problem about my project the title is not appearing

this one is in my controllerbase

use Phalcon\Mvc\Controller,
    Phalcon\Tag as Tag,
    Phalcon\Mvc\Dispatcher;

class ControllerBase extends Controller
{
    public function initialize(){
        Tag::prependTitle('PhalconStore | ');
    }
}

this is my company controller

use Phalcon\Mvc\Controller,
    Phalcon\Tag as Tag,
    Phalcon\Mvc\Dispatcher;

class CompanyController extends ControllerBase
{
    public function initatize(){
        parent::initialize();
        Phalcon\Tag::setTitle('Company');
        $this->view->setLayout('company');
    }

    public function indexAction()
    {

    }
}

my title should look like this Phalconstore | Company but it's not doing it.



84.5k
Accepted
answer

You have to call parent::initialize after setTitle:

public function initatize(){        
        Phalcon\Tag::setTitle('Company');
        parent::initialize();
        $this->view->setLayout('company');
}

thanks a lot sir @Phalcon it works.