2009-04-03 15:59:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Smarty method registerDefaultTemplateHandler
|
|
|
|
|
*
|
|
|
|
|
* Registers a default template handler
|
|
|
|
|
*
|
|
|
|
|
* @package Smarty
|
|
|
|
|
* @subpackage SmartyMethod
|
|
|
|
|
* @author Uwe Tews
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Smarty class registerDefaultTemplateHandler
|
|
|
|
|
*
|
|
|
|
|
* Registers a default template handler
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class Smarty_Method_registerDefaultTemplateHandler extends Smarty_Internal_Base {
|
|
|
|
|
/**
|
|
|
|
|
* Registers a default template handler
|
|
|
|
|
*
|
2009-04-04 15:46:09 +00:00
|
|
|
* @param string $ |array $function class/methode name
|
2009-04-03 15:59:40 +00:00
|
|
|
*/
|
2009-04-04 15:46:09 +00:00
|
|
|
public function execute($function)
|
2009-04-03 15:59:40 +00:00
|
|
|
{
|
2009-04-04 15:46:09 +00:00
|
|
|
if (is_callable($function)) {
|
|
|
|
|
$this->smarty->default_template_handler_func = $function;
|
2009-04-03 15:59:40 +00:00
|
|
|
} else {
|
2009-04-04 15:46:09 +00:00
|
|
|
throw new Exception('Default template handler "'.$function.'" not callable');
|
2009-04-03 15:59:40 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|