Example #1
0
 /**
  * Renders the view and sends the results to the browser. Please note
  * that in order to ensure that the script output will be a valid
  * XML document, this method can be called only once, for one XML view, forcing
  * you to modularize the templates with the template inheritance or
  * opt:include instruction.
  *
  * @param Opt_View $view The view object to be rendered.
  * @return Boolean True, if succeed.
  */
 public function render(Opt_View $view)
 {
     if ($this->_parser === null) {
         $this->_parser = $view->getParser();
         // Initialize output buffering and turn on the compression, if necessary.
         if (!$this->_tpl->debugConsole && $this->_tpl->gzipCompression == true && extension_loaded('zlib') && ini_get('zlib.output_compression') == 0) {
             ob_start('ob_gzhandler');
             ob_implicit_flush(0);
         } else {
             ob_start();
         }
         // Send the headers, if necessary
         $this->sendHeaders();
     } elseif ($this->_parser == 'Html' || $this->_parser == 'Xml') {
         throw new Opt_OutputOverloaded_Exception();
     }
     return $view->_parse($this, true);
 }