1: <?php
2:
3: /**
4: * Smarty Method SetDebugTemplate
5: *
6: * Smarty::setDebugTemplate() method
7: *
8: * @package Smarty
9: * @subpackage PluginsInternal
10: * @author Uwe Tews
11: */
12: class Smarty_Internal_Method_SetDebugTemplate
13: {
14: /**
15: * Valid for Smarty and template object
16: *
17: * @var int
18: */
19: public $objMap = 3;
20:
21: /**
22: * set the debug template
23: *
24: * @api Smarty::setDebugTemplate()
25: *
26: * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
27: * @param string $tpl_name
28: *
29: * @return \Smarty|\Smarty_Internal_Template
30: * @throws SmartyException if file is not readable
31: */
32: public function setDebugTemplate(Smarty_Internal_TemplateBase $obj, $tpl_name)
33: {
34: $smarty = $obj->_getSmartyObj();
35: if (!is_readable($tpl_name)) {
36: throw new SmartyException("Unknown file '{$tpl_name}'");
37: }
38: $smarty->debug_tpl = $tpl_name;
39: return $obj;
40: }
41: }
42: