Changeset 8138
- Timestamp:
- 03/28/08 17:21:34 (1 year ago)
- Files:
-
- branches/1.1/UPGRADE (modified) (1 diff)
- branches/1.1/lib/view/sfPHPView.class.php (modified) (4 diffs)
- branches/1.1/lib/view/sfView.class.php (modified) (1 diff)
- branches/1.1/lib/view/sfViewCacheManager.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/UPGRADE
r7963 r8138 562 562 factory, not only the `sfFileCache`. 563 563 564 Layout 565 ------ 566 567 The action template variables are not available anymore in the layout. This means that the layout 568 only has access to **global** variables (all `sf_` variables) and variables registered via the 569 `template.filter_parameters` event. 570 571 Refer to this wiki page for more information on how to upgrade: 572 573 http://trac.symfony-project.com/wiki/Symfony11LayoutUpgrade 574 564 575 NOTE to early adopters 565 576 ---------------------- branches/1.1/lib/view/sfPHPView.class.php
r7967 r8138 112 112 113 113 /** 114 * Loop through all template slots and fill them in with the results of 115 * presentation data. 114 * Loop through all template slots and fill them in with the results of presentation data. 116 115 * 117 * @param string A chunk of decorator content116 * @param string A chunk of decorator content 118 117 * 119 118 * @return string A decorated template … … 127 126 128 127 // set the decorator content as an attribute 129 $this->attributeHolder->set('sf_content', $content); 128 $attributeHolder = $this->attributeHolder; 129 130 $this->attributeHolder = $this->initializeAttributeHolder(array('sf_content' => $content)); 130 131 131 132 // render the decorator template and return the result 132 return $this->renderFile($this->getDecoratorDirectory().'/'.$this->getDecoratorTemplate()); 133 $ret = $this->renderFile($this->getDecoratorDirectory().'/'.$this->getDecoratorTemplate()); 134 135 $this->attributeHolder = $attributeHolder; 136 137 return $ret; 133 138 } 134 139 … … 146 151 $uri = $this->context->getRouting()->getCurrentInternalUri(); 147 152 148 list($content, $ attributeHolder, $decoratorTemplate) = $viewCache->getActionCache($uri);153 list($content, $decoratorTemplate) = $viewCache->getActionCache($uri); 149 154 if (!is_null($content)) 150 155 { 151 $this->attributeHolder = $attributeHolder;152 156 $this->setDecoratorTemplate($decoratorTemplate); 153 157 } … … 165 169 if (sfConfig::get('sf_cache')) 166 170 { 167 $content = $viewCache->setActionCache($uri, $content, $this-> attributeHolder, $this->isDecorator() ? $this->getDecoratorDirectory().'/'.$this->getDecoratorTemplate() : false);171 $content = $viewCache->setActionCache($uri, $content, $this->isDecorator() ? $this->getDecoratorDirectory().'/'.$this->getDecoratorTemplate() : false); 168 172 } 169 173 } branches/1.1/lib/view/sfView.class.php
r8083 r8138 120 120 sfOutputEscaper::markClassAsSafe('sfForm'); 121 121 122 $this->attributeHolder = false === sfConfig::get('sf_escaping_method') ? new sfViewParameterHolder() : new sfEscapedViewParameterHolder(); 123 $this->attributeHolder->initialize($this->dispatcher, array(), array( 122 $this->attributeHolder = $this->initializeAttributeHolder(); 123 124 $this->parameterHolder = new sfParameterHolder(); 125 $this->parameterHolder->add(sfConfig::get('mod_'.strtolower($moduleName).'_view_param', array())); 126 127 // include view configuration 128 $this->configure(); 129 130 return true; 131 } 132 133 protected function initializeAttributeHolder($attributes = array()) 134 { 135 $attributeHolder = false === sfConfig::get('sf_escaping_method') ? new sfViewParameterHolder() : new sfEscapedViewParameterHolder(); 136 $attributeHolder->initialize($this->dispatcher, $attributes, array( 124 137 'escaping_method' => sfConfig::get('sf_escaping_method'), 125 138 'escaping_strategy' => sfConfig::get('sf_escaping_strategy'), 126 139 )); 127 140 128 $this->parameterHolder = new sfParameterHolder(); 129 $this->parameterHolder->add(sfConfig::get('mod_'.strtolower($moduleName).'_view_param', array())); 130 131 // include view configuration 132 $this->configure(); 133 134 return true; 141 return $attributeHolder; 135 142 } 136 143 branches/1.1/lib/view/sfViewCacheManager.class.php
r8095 r8138 747 747 } 748 748 749 return array($content, $cache[' attributeHolder'], $cache['decoratorTemplate']);749 return array($content, $cache['decoratorTemplate']); 750 750 } 751 751 … … 759 759 * @return string The cached content 760 760 */ 761 public function setActionCache($uri, $content, $ attributeHolder, $decoratorTemplate)761 public function setActionCache($uri, $content, $decoratorTemplate) 762 762 { 763 763 if (!$this->isCacheable($uri) || $this->withLayout($uri)) … … 766 766 } 767 767 768 $saved = $this->set(serialize(array('content' => $content, ' attributeHolder' => $attributeHolder, 'decoratorTemplate' => $decoratorTemplate, 'response' => $this->context->getResponse())), $uri);768 $saved = $this->set(serialize(array('content' => $content, 'decoratorTemplate' => $decoratorTemplate, 'response' => $this->context->getResponse())), $uri); 769 769 770 770 if ($saved && sfConfig::get('sf_web_debug'))

