/** * perform a redirection the the location property if this object. */ protected function render_redirect() { No2_Logger::no2debug(get_class($this) . "::render_redirect: redirecting to {$this->__redirect_location}"); header("Location: {$this->__redirect_location}"); }
/** * This method is called by the view before rendering a zone. * * The view is asked by the template to render a zone. It first call its * controller pre_render() method with the zone to render. pre_render() * will setup views properties if needed (setup). To do the rendering it * can either output data or return a file (like a template file) that will * be included (or both). It can also control if the zone should be * rendered or not (for example based on authorization) and return a file * or not accordingly. * * This implementation will call the magic protected method render_$zone if * it exist. All subclasses are expected to define such method instead of * overriding pre_render(). * * @param $zone * The zone the view has been asked to render. * * @return * a (template) file to be included or null if nothing has to be done by * the view. */ public function pre_render($zone) { $method = "render_{$zone}"; $tpl = null; if ($this->has_protected_method($method)) { $tpl = $this->{$method}(); } if (!is_null($tpl)) { No2_Logger::no2debug(get_class($this) . "::pre_render(zone={$zone}): " . "sending template " . basename($tpl) . " back to view"); } return $tpl; }