问题描述:

I am using Twig Template Engine and I am new to using this framework. I would like to set the title of the page to "HomePage".

I am not able to do it. Here is the code snippet of PHP/HTML :

$template = $loader->getTemplate('index.html');

$renderArr['title_name'] = "My Home Page";

$renderArr['seq'] = array(1, 2, 3, 4);

$template->display($renderArr);

HTML

 {% include 'header.html' %}

<title>{{ title_name }}</title> <!-- Not working -->

<!-- Working -->

{% for item in seq %}

<li>${item|escape}</li>

{% endfor %}

Any idea how to do it ?

相关阅读:
Top