/** * Renders the current template, returning the result as a string. * @return string */ public function display() { foreach (PicoraEvent::getObserverList('PicoraView.beforeDisplay') as $callback) { call_user_func($callback, $this); } //extract and unserialize all flash values and extract content blocks if (isset($_SESSION[PicoraController::FLASH_SESSION_KEY_NAME])) { foreach ($_SESSION[PicoraController::FLASH_SESSION_KEY_NAME]['values'] as $__key__ => $__value__) { ${$__key__} = unserialize($__value__); } } //bring controller instance variables, content blocks, and view instance variables into scope extract(array_merge(PicoraDispatcher::getCurrentController() ? array_merge(PicoraDispatcher::getCurrentController()->params, get_object_vars(PicoraDispatcher::getCurrentController())) : array(), self::$__sections__, get_object_vars($this)), EXTR_REFS); //include file and return output ob_start(); if ($this->__is_string__) { eval(' ?>' . $this->__file__ . '<?php '); } else { include $this->__file__; } $output = ob_get_clean(); foreach (PicoraEvent::getObserverList('PicoraView.afterDisplay') as $callback) { call_user_func($callback, $output); } return $output; }