Extension:SmartyAdaptor

Purpose
Provides integration with Smarty Template Engine by providing a hook to other extensions.

Features

 * Hook based for easy integration
 * hook smarty: used when template resource is located through the filesystem
 * hook smarty_direct: used to pass template source directly
 * Debug information available on Special:Version

Configuration Notes
Two directories must be accessible and writable by PHP / WEB Server: Where $IP is the global PHP variable denoting MediaWiki's installation path. E.g. /var/www/html/wiki
 * $IP/smarty/cache
 * $IP/smarty/compile

On Linux, one must use, as example, chown apache cache to make the directory writable for the owner apache.

Hook smarty
Other extensions use Extension:SmartyAdaptor for their templating needs through the hook smarty.

Calling Method
wfRunHooks( 'smarty', array( $name, $tpl_path, $params, &$result ) );
 * $name: name of template; only useful when other extensions want to insert themselves in the chain
 * $tpl_path: absolute path to the template file
 * $params: array of parameters. E.g. array( 'var1' => 'value1' ... )
 * $result: result

Hook smarty_direct
Other extensions use Extension:SmartyAdaptor for their templating needs through the hook smarty_direct.

Calling Method
wfRunHooks( 'smarty_direct', array( $name, $tpl_source, $params, &$result ) );
 * $name: name of template; only useful when other extensions want to insert themselves in the chain
 * $tpl_source: template source
 * $params: array of parameters. E.g. array( 'var1' => 'value1' ... )
 * $result: result

Dependencies

 * StubManager extension version >= 1.2.0
 * Smarty: available at official site or PEAR-Smarty