bbsengine3 handbook: template-system

template system

bbsengine3 uses smarty3 for templates

in bbsengine2 and earlier, some constants needed to be defined for use by getsmarty(). bbsengine3 allows the app to override getsmarty() and build an 'options' array. the keys available are: 'templatedir', 'pluginsdir', 'compiledir', and 'compileid'. 'templatedir' and 'pluginsdir' can be an array of paths which gives functionality similar to include_path in php.ini.

the webapp is allowed to override getsmarty() and pass whatever options array it needs to.

unfortunately this means that the order of the require_once calls must be in a certain order if the overrides are to be preserved.

using the 'templatesdir' array, it is easy to have a folder with common (* templates.

getsmarty() returns a configured Smarty3 object instance. it assigns variables into the template like 'currentmemberid' and 'currentmember' so that basic access checks can be done within a smarty3 template.