Documentation / Views

Views are HTML-like files used by the template engine to render content to the page.

By convention, view files should be placed inside a views/ directory inside of the module?s directory. They should also use the .tpl file extension.


The rendering of the views is handled by a Renderer. This class is used to abstract the template engine?s classes, allowing Orion to use any third-party templating system (see Orion / Renderer).

Please note that the default, built-in, templating system used by Orion is Smarty. Orion being highly extensible, you could easily write your own abstraction layer for another third-party template engine, or even write your own engine from scratch using the Core\Renderer\Base Interface as a start.


For a more in-depth guide on how to build and use view files, you should first read the documentation of the template engine that you are going to use to render those views (By default, Smarty).

The methods used to assign template variables and render views are described in Orion / Controller #template.

Simply note that, while all renderers should follow the Renderer\Base Interface, not all the template engines abstracted by these renderers will support the entire set of features (for example, some rendering engines does not support caching).

Back to top