- Timestamp:
- Jan 11, 2005, 10:44:31 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.php
r675 r687 56 56 // This will hold the uncompiled code for that handle. 57 57 var $uncompiled_code = array(); 58 59 // output 60 var $output = ''; 58 61 59 62 /** … … 133 136 eval($this->compiled_code[$handle]); 134 137 return true; 138 } 139 140 /** 141 * fills $output template var 142 */ 143 function parse($handle) 144 { 145 if (!$this->loadfile($handle)) 146 { 147 die("Template->pparse(): Couldn't load template file for handle $handle"); 148 } 149 150 // actually compile the template now. 151 if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle])) 152 { 153 // Actually compile the code now. 154 $this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle], true, '_str'); 155 } 156 157 // Run the compiled code. 158 $_str = ''; 159 eval($this->compiled_code[$handle]); 160 $this->output.= $_str; 161 162 return true; 163 } 164 165 /** 166 * prints $output template var 167 */ 168 function p() 169 { 170 echo $this->output; 135 171 } 136 172
Note: See TracChangeset
for help on using the changeset viewer.