systemSmartyBase

systemSmartyBase class provides some useful additional functions for Smarty and setup routines to ensure that the cache and compile folders are always created in a consistent manner. Any application using Smarty should run through this adaptor.

To use; simply instantiate and pass the name of the folder you want the cache files to be created in. This is usually the application or website domain name.

$oSmarty = new systemSmartyBase();
$oSmarty->setTemplateDir('/path/to/websites');
$oSmarty->setConfigDir('/path/to/config/folder');
$oSmarty->setCompileDir('myApp');
$oSmarty->setCacheDir('myApp');
$oSmarty->setUseSubDirs(true);
$oSmarty->assign('something','somevalue');
$oSmarty->display('template.tpl');

Methods

public __construct()

Create Smarty environment

public setCompileDir([$compile_dir = null])

Sets the compile dir, this should be the name of the application and NOT a full path

public setCacheDir([$cache_dir = null])

Set cache dir, this should be the name of the application and NOT a full path

protected checkFolderForPath($inFolder)

Checks if the folder is a path, returning the last item if it is

protected createFolder($inFolder)

Creates the folder $inFolder


Inherited Methods

<  1  >