Files
smarty/libs/sysplugins/method.register_resource.php
Uwe.Tews d2d8c8925b - removed all internal calls of Smarty::instance()
- fixed code in double quoted strings
2009-08-08 17:28:23 +00:00

34 lines
899 B
PHP

<?php
/**
* Smarty method Register_Resource
*
* Registers a Smarty template resource
*
* @package Smarty
* @subpackage SmartyMethod
* @author Uwe Tews
*/
/**
* Registers a resource to fetch a template
*
* @param object $smarty
* @param string $type name of resource
* @param array $functions array of functions to handle resource
*/
function register_resource($smarty, $type, $functions)
{
if (count($functions) == 4) {
$smarty->_plugins['resource'][$type] =
array($functions, false);
} elseif (count($functions) == 5) {
$smarty->plugins['resource'][$type] =
array(array(array(&$functions[0], $functions[1]) , array(&$functions[0], $functions[2]) , array(&$functions[0], $functions[3]) , array(&$functions[0], $functions[4])) , false);
} else {
throw new Exception("malformed function-list for '$type' in register_resource");
}
}
?>