Documentation: View Templates
Your project view templates SHOULD be located in templates folder. Folder structure:
A view (located in views folder above) is seen as a template that may be composed of:
- HTML tags
- pseudo-HTML tag libraries (located in tags folder above): user defined, to be compiled when response is composed
- macro tags: predefined tags destined to be expanded before compilation (eg: include statements)
- expressions: sections of view language programming (variables + control structures) to be compiled into PHP later on
Functional requirements so that above API will be able to process above (most fulfilled already when framework is installed):
- a <templating> tag with following body in stdout.xml:
<templating compilations_path="compilations" tags_path="templates/tags" templates_path="templates/views" templates_extension="html"/>
- a <resolvers> tag with following body in stdout.xml:
<resolver format="html" content_type="text/html" class="Lucinda\Project\ViewResolvers\Html" charset="UTF-8"/>
- a Lucinda\Project\ViewResolvers\Html that resolves html response format using View Language API compiler
- a compilations folder in project root where intermediate PHP compilations will be saved
- all views/tags you develop MUST have .html extension
To learn more how to work with views and also make it work for other formats than html, check Tutorial!