- Adroit views are powered by the popular and powerful Smarty Template Engine. For more information about specific Smarty syntax and tags, please visite their website.
- Aside from the standard Smarty templating system, Adroit does provide some nice features when it comes to creating your views. Views map directly to controller action methods. For more information on controllers, please visit the controllers section. Every controller class should have a correlating directory in the app/view/ location that houses views for that particular controller. For example, if you have a controller, TestController, you would have a directory structure such as app/view/test/ where your views would reside.
- If you are creating a view that maps to a url such as www.mytestsite.com/test/register/, it would call the TestController.registerAction() method, which would then load the app/view/test/register.tpl view template.
- A very nice feature of Smarty is the ability to use tempate configuration files. This is a file where you can assign different configuration attributes for your templates, such as page titles, meta tag values, page specific values, or any other flags that may be useful in your templates, but you want to keep them abstracted into a configuration file. Adroit uses the file app/view/template-config.conf for the Smarty configuration file. Here you can load in whatever values your specific website needs. Smarty config files allow you to create "sections" that can be loaded for different pages. For more information on that, visit this link. Adroit will by default, try and load a section named according to the current "package" (subdirectory for your controller), "controller", and "action". If I had a specific page that was mapped to a TestController.registerAction, Adroit would attempt to load the [TestRegister] section. If TestController as in an "admin" subdirectory, it would try and load the [AdminTestRegister] section.