4 * Smarty Method RegisterResource
6 * Smarty::registerResource() method
9 * @subpackage PluginsInternal
12 class Smarty_Internal_Method_RegisterResource
15 * Valid for Smarty and template object
22 * Registers a resource to fetch a template
24 * @api Smarty::registerResource()
25 * @link http://www.smarty.net/docs/en/api.register.resource.tpl
27 * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
28 * @param string $name name of resource type
29 * @param Smarty_Resource|array $resource_handler or instance of
31 * array of callbacks to
35 * @return \Smarty|\Smarty_Internal_Template
37 public function registerResource(Smarty_Internal_TemplateBase $obj, $name, $resource_handler)
39 $smarty = $obj->_getSmartyObj();
40 $smarty->registered_resources[ $name ] =
41 $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false);