In the default Codeigniter installation there is the "welcome" controller which has a "index" action which loads the "welcome" view. This works as expected.
However, upon inspecting the "welcome" view I can see this variable in the footer.
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
From what I understand the variable {elapsed_time}
is an example of using the built in template parser with text representations instead of using PHP short tags to echo variables.
But inside the "welcome" controller the only lines in the "index" action are these.
$this->load->view('welcome');
And it doesn't pass $data['elapsed_time']='xxx';
which means that I can't figure out where the variable elapsed_time
is coming from!
My question is this.
Where does elapsed_time
get defined? Is it built into the template parser class (and therefore available to be used without first defining it)? If so, where is a list of these other pre-defined varaibles? I would like to know what else I have access to as had I known that elapsed_time
was available to me it would have been very useful. Does anyone have a list of the template parser pre-defined variables?
Thanks in advance.
elapsed_time defined output class. this class is initialized automatically by CodeIgniter.
more info here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With