rex()
has been assigned as an helper function to render templates.
This function has made it easier to relate with template content and provided more extended functionalities.
The new directive @rex()
is now being introduced as a template directive to make it easier to load an
external template from another template. This directive works similarly as the rex()
function except that
it does not support the chaining of methods. With this new directive, we can easily import web page into another url address.
This makes it easier to connect different urls to one single source template file.
The code sample below represents a source page template file "sample.rex.php".
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sample Template</title> </head> <body> This is a source template </body>
@rex()
directive as shown below
@rex('sample') <!-- import template -->
@view()
directive.
@do:
@while();
, switch
conditions and test
loops which includes
@case():
,
@default:
,
@test():
and a new shorthand directive for for
loops which is the
@loop():
directive. It is suggested to revisit the directives
documentation to learn more about these directives.