CodeIgniter Forums

Full Version: A few questions.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ShadowMage[/eluser]
I would like some answers =]

1. How can you automatically load, or perform functions without calling them in all the controllers?

2. Can you call $this->lang->line in any controller or view without loading the language file in the controller itself or the view?

3. Is there a CodeIgniter function to get the total number of database queries executed on the page?

Thanks =]

El Forum

[eluser]jedd[/eluser]
[quote author="ShadowMage" date="1238220136"]
1. How can you automatically load, or perform functions without calling them in all the controllers?[/quote]

[url="http://ellislab.com/forums/viewthread/109698/#553141"]Here's one way[/url] that I posted recently in another thread.

Can't help you with #2.

Quote:3. Is there a CodeIgniter function to get the total number of database queries executed on the page?

Maybe not as a single integer, but the [url="http://ellislab.com/codeigniter/user-guide/general/profiling.html"]Profiling Class[/url] will provide the data you're looking for.

El Forum

[eluser]ShadowMage[/eluser]
But wouldn't the profiling class screw up and place everything? or can you just select different things to display? x:

El Forum

[eluser]jedd[/eluser]
It's almost like you're intending to keep the number of database calls visible on every page, even in production.

Uhm, you could delve into the profiling class and see how it does it. I have no idea how you'd go about trying to rip components of that out, though, other than cut-n-paste, perhaps trying to override the class.

Can I ask what the motivation is here to have a subset of the profiling information shown?