[Question]Twig Template Engin

Hi all,

I’m very eager to start with Yii 2.0 but I have a problem when use Twig template engine.

I set page title like below:

{% set this.title = 'My Yii Application' %}

But I get the error:

Unexpected token "punctuation" of value "." ("end of statement block" expected)

Please teach me how to fix it.

Thank you very much.


For those who has the same problem, we have to set page title in controller instead. (thanks guys in Yii Framework Facebook Group)

You can do like this:

$this->view->title = "My Yii Application"

if you’ve correctly set twig plateform, and main.twig as default template that should be work :

{{ set(this, ‘title’, 'My Yii Application ') }}