[Cs-content-commits] SF.net SVN: cs-content:[443] trunk/1.0/contentSystem.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-18 20:31:57
|
Revision: 443 http://cs-content.svn.sourceforge.net/cs-content/?rev=443&view=rev Author: crazedsanity Date: 2009-08-18 20:31:49 +0000 (Tue, 18 Aug 2009) Log Message: ----------- Add templates immediately instead of during finish(). /contentSystem.class.php: * finish(): -- no longer add templates at this point (already added) * add_template(): -- calls templateObj->add_template_file() immediately (facilitates more unit testing). Modified Paths: -------------- trunk/1.0/contentSystem.class.php Modified: trunk/1.0/contentSystem.class.php =================================================================== --- trunk/1.0/contentSystem.class.php 2009-08-18 18:55:52 UTC (rev 442) +++ trunk/1.0/contentSystem.class.php 2009-08-18 20:31:49 UTC (rev 443) @@ -807,13 +807,6 @@ unset($this->templateList['index']); } - foreach($this->templateList as $mySection => $myTmpl) { - $myTmpl = preg_replace("/\/\//", "/", $myTmpl); - $page->add_template_file($mySection, $myTmpl); - } - unset($mySection); - unset($myTmpl); - //make the "final section" available to scripts. $finalSection = $this->finalSection; $sectionArr = $this->sectionArr; @@ -938,7 +931,8 @@ //------------------------------------------------------------------------ private final function add_template($var, $file) { - $this->templateList[$var] = $file; + $file = preg_replace("/\/\//", "/", $file); + $this->templateObj->add_template_file($var, $file); }//end add_template() //------------------------------------------------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |