CodeIgniter Forums
Components and Libraries - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Components and Libraries (/showthread.php?tid=28268)



Components and Libraries - El Forum - 03-06-2010

[eluser]Roni Peterson[/eluser]
Hi everyone!

I'm trying understand how can I use components, or this idea, in CodeIgniter. The purpose is disconnect some areas into my page to reuse determined common areas like a area of login or a area that will be an information that must be present into any views.

Also, this area will have some functionality, in the example of login area, the component must detect the state after login and then show a panel with options like "logout".

I read one comment about components in http://ellislab.com/forums/viewthread/116005/ where the author (Dam1an) says:

"A librray is a set of relation functionality, and when using OOP, it represents an object, such as a user.
The idea is that it should be reusable, whereas controller logic is pretty specific to that app (although you can do a fair bot of copy and pasting between apps)

As for helpers, they’re also related bits of functionality, but each function works on its own, whereas in a lirary, it will often depend on class variables"

Please, can anyone help me understand this ideia in CodeIgniter ?

Thank you!


Components and Libraries - El Forum - 03-06-2010

[eluser]Roni Peterson[/eluser]
Is correct, into a controller, make a instance of other controller to do something ?