
What is the Smarty template engine?
What is the Smarty template engine?
The Smarty template engine is the underlying technology, enabling XOOPS developers to create layouts for pages, which resemble standard HTML. This makes it easy for a non-PHP designer to create visually advanced layouts without having to learn PHP Smarty Tags The XOOPS tag for using Smarty code is to enclose statements in <{ and }> The most used Smarty code is
le="color: #000000"><?php <{$variable_name}>
for inserting variables "assigned" to Smarty in the PHP files and
le="color: #000000"><?php <{foreach item=item_name_in_loop from=$array_containing_data}> <{$item_name_in_loop.name_of_index}> <{/foreach}>
for looping through array values.
Variable Assignment Variables are assigned in PHP files like this:
le="color: #000000"><?php $xoopsTpl->assign('variable_name', $variable_value);
for assigning a value to a variable (corresponds to the PHP statement $variable_name = $variable_value) or
le="color: #000000"><?php $xoopsTpl->append('array_name', $variable_value);
for adding a value to an array (corresponds to the PHP statement $array_name[] = $variable_value) Much more information about Smarty is available on
smarty.php.net
This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=115