user3752621
user3752621

Reputation: 67

How to set custom title in Phalcon Controller

I was created a main layout , layouts , and controller view .

But how to set custom title product / name in view ?

Main layouts

{{ get_doctype() }} 
<html>  
<head>      
    {{ get_title() }}
</head>     
<body>    
    {{ content() }} 
</body> 
</html>

Layouts

{{ content() }}

And Controllers View

"Controller View"

In IndexController

Phalcon\Tag::setTitle("Welcome to my Page");

And Nothing return ? Please help !

Upvotes: 3

Views: 1023

Answers (1)

ragnar
ragnar

Reputation: 1302

Checkout the example base controller located in https://github.com/phalcon/invo/blob/master/app/controllers/ControllerBase.php

Later look at how the other controllers use initialize() to define tittle.

Upvotes: 2

Related Questions