在PHP模板中,我可以使用php函数,例如:
foreach ($users as $user){
echo someFunction($user->getName());
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能在TWIG中制作它?
{% for user in users %}
* {{ user.name }}
{% else %}
No user have been found.
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我该如何实现这一目标?
如何在Symfony中创建多语言页面?在Symfony 1.0中,Jobeet教程有很好的描述.但现在在symfony.com上,我还没有看到与翻译页面有关的事情.在symfony 1.4中,echo __('text'); 使用,但现在使用Symfony 2 TWIG.