|
From: Benjamin C. <bc...@us...> - 2004-07-03 12:59:25
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5823 Modified Files: Tag: htmltemplates include.php Log Message: Added the fetch function to the template class Index: include.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/include.php,v retrieving revision 1.126.4.7 retrieving revision 1.126.4.8 diff -u -r1.126.4.7 -r1.126.4.8 --- include.php 30 Jun 2004 13:49:51 -0000 1.126.4.7 +++ include.php 3 Jul 2004 12:59:16 -0000 1.126.4.8 @@ -109,13 +109,22 @@ $this->vars = array(); } - function render($content_template, $page_title, $wrap_file = '') { + function render($content_template, $page_title, $wrap_file = '', $nowrap = false) { extract($this->vars); $path = defined('TEMPLATE_PATH') ? './templates/'.THEME.'/'.TEMPLATE_PATH.'/' : './templates/'.THEME.'/'; - include($wrap_file ? $path.$wrap_file : $path.'wrap.html'); + include($nowrap ? $path.$content_template : ($wrap_file ? $path.$wrap_file : $path.'wrap.html')); } + + function fetch($content_template) { + ob_start(); + $this->render($content_template, '', '', true); + $rettext = ob_get_contents(); + ob_end_clean(); + return $rettext; + } + function assign($var, $value = '') { if (is_array($var)) { |