-
Notifications
You must be signed in to change notification settings - Fork 40
Basics
Once TwigView is active you can start by creating new view files using the .tpl
extension.
This is probably how it looks right now.
views/users/
login.ctp
If you want to rewrite the view using Twig simply create a .tpl
.
views/users/
login.ctp
login.tpl
They can live next to each other. No problem. Twig will load the .tpl as long as the view is active. The TwigView simply prefers files with .tpl extension and does nothing if there is none. Of course, if you have neither you will get the default missing_view error.
I've added a special section about Helpers in the wiki that gives a quick overview how these are handled. The plugin itself comes with all the default layouts so make sure to check those out to get an idea.
There's also a plain index view for a users table with common php mixed in. All these examples can be found in the ./examples
directory among other things like {{ extends }}
and such.
You can do everything you can expect from Twig. I haven't reached any limits so if you have found one, let me know. Explaining Twig syntax itself is however beyond the scope of this documentation.
TwigView brings in some extra filters which are explained here