Having fun with Twig right now. Here’s a draft View implementation with i18n support. Just a gist, but works very well for me.
For those who don’t know what Twig is:
- Twig is a template language.
- http://www.twig-project.org
The good old default.ctp in Twig
{{ html.charset() }}
{{ 'CakePHP: the rapid development php framework'|trans }}: {{ title_for_layout }}
{{ html.meta('icon') }}
{{ html.css('cake.generic') }}
{{ scripts_for_layout }}
{{
html.link('CakePHP: the rapid development php framework'|trans, 'http://cakephp.org')
}}
{{ session.flash() }}{{ session.flash('auth') }}
{{ content_for_layout }}
{{
html.image('cake.power.gif', [
'alt': 'Powered by CakePHP'|trans,
'url': 'http://cakephp.org'
])
}}
Here’s my TwigView class
==UPDATED==
It's a repo now:
> http://github.com/m3nt0r/cakephp-twig-view
There are also more examples and examples using FormHelper at github.
View the full gist: http://gist.github.com/589273
