Changeset 1449
- Timestamp:
- 01/01/07 19:49:23 (2 years ago)
- Location:
- branches/david-execution_flow/src/renderer
- Files:
-
- 2 modified
-
AgaviPhpRenderer.class.php (modified) (2 diffs)
-
AgaviRenderer.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/david-execution_flow/src/renderer/AgaviPhpRenderer.class.php
r1448 r1449 34 34 */ 35 35 protected $extension = '.php'; 36 37 /**38 * Loop through all template slots and fill them in with the results of39 * presentation data.40 *41 * @param string A chunk of decorator content.42 *43 * @return string A decorated template.44 *45 * @author Sean Kerr <skerr@mojavi.org>46 * @since 0.11.047 */48 public function decorate($content)49 {50 // call our parent decorate() method51 parent::decorate($content);52 53 // DO NOT USE VARIABLES IN HERE, THEY MIGHT INTERFERE WITH TEMPLATE VARS54 55 if($this->extractVars) {56 extract($this->view->getAttributes(), EXTR_REFS | EXTR_PREFIX_INVALID, '_');57 } else {58 ${$this->varName} =& $this->view->getAttributes();59 }60 61 $collisions = array_intersect(array_keys($this->assigns), $this->view->getAttributeNames());62 if(count($collisions)) {63 throw new AgaviException('Could not import system objects due to variable name collisions ("' . implode('", "', $collisions) . '" already in use).');64 }65 extract($this->assigns);66 67 // render the decorator template and return the result68 ob_start();69 70 require($this->view->getDecoratorDirectory() . '/' . $this->buildTemplateName($this->view->getDecoratorTemplate()));71 72 $retval = ob_get_contents();73 ob_end_clean();74 75 return $retval;76 }77 36 78 37 /** … … 130 89 } 131 90 } 91 92 ?> -
branches/david-execution_flow/src/renderer/AgaviRenderer.class.php
r1448 r1449 41 41 42 42 /** 43 * @var AgaviView The View instance that belongs to this Renderer.44 */45 protected $view = null;46 47 /**48 43 * @var string The name of the array that contains the template vars. 49 44 */ … … 160 155 } 161 156 162 /**163 * Set the View instance that belongs to this Renderer instance.164 *165 * @param AgaviView An AgaviView instance166 *167 * @author David Zuelke <dz@bitxtender.com>168 * @since 0.11.0169 */170 public function setView($view)171 {172 $this->view = $view;173 }174 175 /**176 * Retrieve the View instance that belongs to this Renderer instance.177 *178 * @return AgaviView An AgaviView instance179 *180 * @author David Zuelke <dz@bitxtender.com>181 * @since 0.11.0182 */183 public function getView()184 {185 return $this->view;186 }187 188 157 /** 189 158 * Build a template name based on "literal" flag in the template info.

