Changeset 4885
- Timestamp:
- 08/22/07 18:37:38 (1 year ago)
- Files:
-
- trunk/lib/action/sfActionStackEntry.class.php (modified) (2 diffs)
- trunk/lib/helper/AssetHelper.php (modified) (1 diff)
- trunk/lib/helper/PartialHelper.php (modified) (1 diff)
- trunk/lib/util/sfContext.class.php (modified) (1 diff)
- trunk/lib/view/sfPHPView.class.php (modified) (1 diff)
- trunk/lib/view/sfViewCacheManager.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/action/sfActionStackEntry.class.php
r3198 r4885 25 25 $actionName = null, 26 26 $moduleName = null, 27 $presentation = null, 28 $viewInstance = null; 27 $presentation = null; 29 28 30 29 /** … … 63 62 64 63 /** 65 * Retrieves this entry's view instance.66 *67 * @return sfView A sfView implementation instance.68 */69 public function getViewInstance()70 {71 return $this->viewInstance;72 }73 74 /**75 * Sets this entry's view instance.76 *77 * @param sfView A sfView implementation instance.78 */79 public function setViewInstance($viewInstance)80 {81 $this->viewInstance = $viewInstance;82 }83 84 /**85 64 * Retrieves this entry's module name. 86 65 * trunk/lib/helper/AssetHelper.php
r3777 r4885 232 232 function decorate_with($layout) 233 233 { 234 $view = sfContext::getInstance()->getActionStack()->getLastEntry()->getViewInstance();235 234 if (false === $layout) 236 235 { 237 $view->setDecorator(false);236 sfContext::getInstance()->get('view_instance')->setDecorator(false); 238 237 } 239 238 else 240 239 { 241 $view->setDecoratorTemplate($layout);240 sfContext::getInstance()->get('view_instance')->setDecoratorTemplate($layout); 242 241 } 243 242 } trunk/lib/helper/PartialHelper.php
r4850 r4885 55 55 function get_component_slot($name, $vars = array()) 56 56 { 57 $context = sfContext::getInstance(); 58 59 $actionStackEntry = $context->getController()->getActionStack()->getLastEntry(); 60 $viewInstance = $actionStackEntry->getViewInstance(); 57 $viewInstance = sfContext::getInstance()->get('view_instance'); 61 58 62 59 if (!$viewInstance->hasComponentSlot($name)) trunk/lib/util/sfContext.class.php
r4845 r4885 219 219 220 220 /** 221 * Retrieve the current view instance for this context.222 *223 * @return sfView The currently view instance, if one is set,224 * otherwise null.225 */226 public function getCurrentViewInstance()227 {228 // get the last action stack entry229 if ($this->factories['actionStack'] && $lastEntry = $this->factories['actionStack']->getLastEntry())230 {231 return $lastEntry->getViewInstance();232 }233 }234 235 /**236 221 * Retrieve the request. 237 222 * trunk/lib/view/sfPHPView.class.php
r4603 r4885 93 93 { 94 94 // store our current view 95 $actionStackEntry = $this->context->getActionStack()->getLastEntry(); 96 if (!$actionStackEntry->getViewInstance()) 97 { 98 $actionStackEntry->setViewInstance($this); 99 } 95 $this->context->set('view_instance', $this); 100 96 101 97 // require our configuration trunk/lib/view/sfViewCacheManager.class.php
r4850 r4885 587 587 public function setPageCache($uri) 588 588 { 589 if (sfView::RENDER_CLIENT != $this->cont ext->getController()->getRenderMode())589 if (sfView::RENDER_CLIENT != $this->controller->getRenderMode()) 590 590 { 591 591 return; … … 620 620 $cachedResponse = unserialize($retval); 621 621 622 $controller = $this->context->getController(); 623 if (sfView::RENDER_VAR == $controller->getRenderMode()) 624 { 625 $controller->getActionStack()->getLastEntry()->setPresentation($cachedResponse->getContent()); 622 if (sfView::RENDER_VAR == $this->controller->getRenderMode()) 623 { 624 $this->controller->getActionStack()->getLastEntry()->setPresentation($cachedResponse->getContent()); 626 625 $this->response->setContent(''); 627 626 }