class SmartyDebug extends Smarty { var $outline_tpl = false; //trueにするとアウトライン表示] function _smarty_include($params){ if ($this->outline_tpl){ echo $this->getOutlineBegin($params['smarty_include_tpl_file']); } parent::_smarty_include($params); if ($this->outline_tpl){ echo $this->getOutlineEnd(); } } function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false){ if ($this->outline_tpl){ if ($display){ echo $this->getOutlineBegin($resource_name); parent::fetch($resource_name, $cache_id, $compile_id, $display); echo $this->getOutlineEnd(); }else{ return $this->getOutlineBegin($resource_name).parent::fetch($resource_name, $cache_id, $compile_id, $display).$this->getOutlineEnd(); } }else{ return parent::fetch($resource_name, $cache_id, $compile_id, $display); } } function getOutlineBegin($resource_name){ return '
'; } } ?>