- Use a base controller all your controllers inherit from
class IndexController extends ControllerBase {
public function initialize() {
Tag::setTitle('Welcome');
parent::initialize();
}
public function indexAction() {
}
}
- define the initialize method in the base controller and define the vars
class ControllerBase extends \Phalcon\Mvc\Controller {
public function initialize(){
$this->view->setVar("globalBlaa","Helllooo");
}
}
- show it in any view
{{globalBlaa }}