Welcome Guest, Not a member yet? Register   Sign In
CI load view
#1

[eluser]SpooF[/eluser]
Is there any way to extend the class the is used to load views?

I'm looking at a way to set up a debug mode for CI. So at the bottom of each page or at the top, much like the user guide, you can view all the variables that have been set for a view.

If extending the class is not an option then I guess making a new library for views is the best option. Would it be possible to "over write" the load class? Its not in the reserved name list. That way the library can be implemented into any CI web app that is using the native view.
#2

[eluser]wiredesignz[/eluser]
Quote:Is there any way to extend the class the is used to load views?
Many people have written View Object(s) or Template libraries (see my signature) so yes its entirely possible.
#3

[eluser]SpooF[/eluser]
I know I can create a library and utilize the features of ->load->view() but what I'm talking about is letting users use the default way of loading views. So in their controllers they can keep the standard $this->load->view('home',$data);, but if a configuration options is set it will allow for debug information to be displayed. That way it can be implemented directly into a CI application with no custom libraries for views.
#4

[eluser]wiredesignz[/eluser]
You could look at extending the CI_Loader class or CI_Output class, find where the variables are cached and display them as needed.

Or simply extend the existing Profiler.




Theme © iAndrew 2016 - Forum software by © MyBB