R3m/framework Function reference require

{require(String $url, Array | Object $data=null)}

Require, require a template view file and compiles it.
If data is set, that data is used to compile the template, else the global data is used.
If you need to load data (from Json) you can use data.read or parse.read.


Split it into sections:

{require($controller.dir.view + 'Section/Head.tpl')}
{require($controller.dir.view + 'Section/Page.tpl')}
{require($controller.dir.view + 'Section/Footer.tpl')}

Returns the compiled template on success as a string.
You can also assign it to a variable.

Last modified: 2021-06-07

© 2021 universeorange.com