PLAYSMS TEMPLATE ENGINE


Locations
---------

Template files are text files with extension .html, must be a .html file.
Please avoid to name a template file as index.html

Example: user_inbox.html or page_welcome.html

Template files are located under directory "templates".

You can find directory templates in several places, they are:
- under directory themes/common/
- under directory themes/<themes name>/
- under each plugin directory


Code samples
------------

Below are example of using templates for inc=noaccess.

File <themes name>/page_noaccess.php:

<?php
defined('_SECURE_') or die('Forbidden');
unset($tpl);
$tpl = array(
	'name' => 'page_noaccess',
	'var' => array(
		'ERROR' => $error_content,
		'HTTP_PATH_BASE' => $core_config['http_path']['base'],
		'Home' => _('Home')
	)
);
$content = tpl_apply($tpl);
echo themes_apply($content);
?>


File <themes name>/templates/page_noaccess.html:

<div align='center'>
{ERROR}
<p><a href='{HTTP_PATH_BASE}'>{Home}</a></p>
</div>


More examples, with demonstrations of logic IF and LOOP in templates, are
located in:
- inc/app/menu.php
- inc/user/user_inbox.php
- themes/common/templates/user_inbox.html
- inc/user/page_welcome.php
- themes/common/templates/page_welcome.html
- inc/user/send_sms.php
- themes/common/templates/send_sms.html
- plugin/feature/inboxgroup/inboxgroup.php
- plugin/feature/inboxgroup/templates/inboxgroup.html
- plugin/tools/report/report.php
- plugin/tools/report/templates/report_admin.html
- plugin/tools/report/templates/report_user.html
- plugin/gateway/nexmo/nexmo.php
- plugin/gateway/nexmo/templates/nexmo.html
- plugin/themes/default/fn.php
- plugin/themes/default/page*.php
- plugin/themes/default/templates/*
- plugin/themes/play/fn.php
- plugin/themes/play/page*.php
- plugin/themes/play/templates/*


--
Anton Raharja
