_display() public method

Processes and sends finalized output data to the browser along with any server headers and profile data. It also stops benchmark timers so the page rendering speed and memory usage can be shown. Note: All "view" data is automatically put into $this->final_output by controller class.
public _display ( string $output = '' ) : void
$output string Output data override
return void
Ejemplo n.º 1
0
 function _display($output = '')
 {
     if (ENVIRONMENT !== 'development') {
         $this->final_output = str_replace('> <', '><', preg_replace("/\\s+|\n+|\r/", ' ', $this->final_output));
     }
     parent::_display($output);
 }
 function _display($output = '')
 {
     parent::_display($output);
     if (class_exists('CI_Controller') && class_exists('Smarty_Internal_Debug') && (config_item('smarty_debug') || $this->enable_profiler)) {
         $CI =& get_instance();
         $smarty_debug = new Smarty_Internal_Debug();
         $smarty_debug->display_debug($CI->ci_smarty);
     }
 }
Ejemplo n.º 3
0
 public function _display($output = '')
 {
     parent::_display($output);
     // If Smarty is active - NOTE: $this->output->enable_profiler(TRUE) active Smarty debug to simplify
     if (class_exists('CI_Controller') && class_exists('Smarty_Internal_Debug') && (config_item('smarty_debug') || $this->enable_profiler)) {
         $CI =& get_instance();
         Smarty_Internal_Debug::display_debug($CI->smarty);
     }
 }
Ejemplo n.º 4
0
 /**
  * (non-PHPdoc)
  * @see system/libraries/CI_Output#_display($output)
  */
 function _display($output = '')
 {
     if ($output == '') {
         $output = $this->get_output();
     }
     switch ($this->_mode) {
         case self::OUTPUT_MODE_TEMPLATE:
             $output = $this->get_template_output($output);
             break;
         case self::OUTPUT_MODE_NORMAL:
         default:
             $output = $output;
             break;
     }
     parent::_display($output);
 }
Ejemplo n.º 5
0
 /**
  * Display the final output
  *
  * @access	public
  * @return	void
  */
 function _display($output = '')
 {
     $EE =& get_instance();
     if ($output == '') {
         $output = $this->final_output;
     }
     // Generate No-Cache Headers
     if ($EE->config->item('send_headers') == 'y' && $this->out_type != 'feed' && $this->out_type != '404' && $this->out_type != 'cp_asset') {
         $this->set_status_header(200);
         $this->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
         $this->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         $this->set_header("Pragma: no-cache");
     }
     // Content Type Headers
     // Also need to do some extra work for feeds
     switch ($this->out_type) {
         case 'webpage':
             $this->set_header("Content-Type: text/html; charset=" . $EE->config->item('charset'));
             break;
         case 'css':
             $this->set_header("Content-type: text/css");
             break;
         case 'js':
             $this->set_header("Content-type: text/javascript");
             $this->enable_profiler = FALSE;
             break;
         case '404':
             $this->set_status_header(404);
             $this->set_header("Date: " . gmdate("D, d M Y H:i:s") . " GMT");
             break;
         case 'xml':
             $this->set_header("Content-Type: text/xml");
             $output = trim($output);
             break;
         case 'feed':
             $this->_send_feed($output);
             break;
         default:
             // Likely a custom template type
             // -------------------------------------------
             // 'template_types' hook.
             //  - Provide information for custom template types.
             //
             $template_types = $EE->extensions->call('template_types', array());
             //
             // -------------------------------------------
             if (isset($template_types[$this->out_type])) {
                 // Set custom headers as defined by the template_headers key,
                 // and replace any headers as necessary
                 if (isset($template_types[$this->out_type]['template_headers'])) {
                     foreach ($template_types[$this->out_type]['template_headers'] as $header) {
                         $this->set_header($header, TRUE);
                     }
                 }
             }
             break;
     }
     // Compress the output
     // We simply set the ci config value to true
     if ($EE->config->item('gzip_output') == 'y' and REQ == 'PAGE') {
         $EE->config->set_item('compress_output', TRUE);
     }
     // Parse query count
     if (REQ != 'CP') {
         $output = str_replace(LD . 'total_queries' . RD, $EE->db->query_count, $output);
     }
     // Send it to the CI method for final processing
     parent::_display($output);
 }
Ejemplo n.º 6
0
 /**
  * Display the final output
  *
  * @access	public
  * @return	void
  */
 function _display($output = '')
 {
     $EE =& get_instance();
     if ($output == '') {
         $output = $this->final_output;
     }
     // Generate No-Cache Headers
     if ($EE->config->item('send_headers') == 'y' && $this->out_type != 'feed' && $this->out_type != '404' && $this->out_type != 'cp_asset') {
         $this->set_status_header(200);
         $this->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
         $this->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         $this->set_header("Pragma: no-cache");
     }
     // Content Type Headers
     // Also need to do some extra work for feeds
     switch ($this->out_type) {
         case 'webpage':
             $this->set_header("Content-Type: text/html; charset=" . $EE->config->item('charset'));
             break;
         case 'css':
             $this->set_header("Content-type: text/css");
             break;
         case 'js':
             $this->set_header("Content-type: text/javascript");
             $this->enable_profiler = FALSE;
             break;
         case '404':
             $this->set_status_header(404);
             $this->set_header("Date: " . gmdate("D, d M Y H:i:s") . " GMT");
             break;
         case 'xml':
             $this->set_header("Content-Type: text/xml");
             $output = trim($output);
             break;
         case 'feed':
             $this->_send_feed($output);
             break;
     }
     // Parse elapsed time and query count
     if (REQ != 'CP') {
         $output = str_replace(LD . 'total_queries' . RD, $EE->db->query_count, $output);
         // If 'debug' is turned off, we will remove any variables that didn't get parsed due to syntax errors.
         if ($EE->config->item('debug') == 0 and $this->remove_unparsed_variables == TRUE) {
             $output = preg_replace("/" . LD . "[^;\n]+?" . RD . "/", '', $output);
         }
     }
     // Compress the output
     // We simply set the ci config value to true
     if ($EE->config->item('gzip_output') == 'y' and REQ == 'PAGE') {
         $EE->config->set_item('compress_output', TRUE);
     }
     // Send it to the CI method for final processing
     parent::_display($output);
 }
 */
$CI = new $class();
if ($RTR->scaffolding_request === TRUE) {
    $CI->_ci_scaffolding();
} else {
    if (!method_exists($CI, $method)) {
        show_404();
    }
    $CI->{$method}();
}
/*
 * ------------------------------------------------------
 *  Send the final rendered output to the browser
 * ------------------------------------------------------
 */
$OUT->_display();
/*
 * ------------------------------------------------------
 *  Close the DB connection of one exists
 * ------------------------------------------------------
 */
if ($CI->_ci_is_loaded('db')) {
    $CI->db->close();
}
// END OF SYSTEM EXECUTION ------------------------------
// Below are some globally accessible helper functions
/**
* Error Handler
*
* This function lets us invoke the exception class and
* display errors using the standard error template located