Skip to content
Derek Jones edited this page Jul 5, 2012 · 4 revisions

Here is a list of Pseudo Variables that you can include in your CodeIgniter Templates:

{elapsed_time} http://codeigniter.com/user_guide/libraries/benchmark.html An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP.

{memory_usage} http://codeigniter.com/user_guide/libraries/benchmark.html An alternate way to show your memory usage in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

NOTE : Are there any more Pseudo Variables ?

NOTE Pseudo Variables are DO NOT seem to be expanded if you are concatenating Templates !

class Srch extends Controller {

function Srch()
{
    parent::Controller();
}

function index()
{
    $this->load->library('parser');

    $data = array( 'btitle' => 'XXX' , 'bhead' => 'YYY' ) ;
    echo $this->parser->parse('head',$data,true);

    $data = array( 'btitle' => 'AAA' , 'bhead' => 'BBB' ) ;
    echo $this->parser->parse('foot',$data,true);

    $this->parser->parse('foot',$data);

    // $this->load->view('search');
}

}

XXX YYY AAA BBB Page rendered in {elapsed_time} seconds

AAA BBB Page rendered in 0.1075 seconds

Clone this wiki locally