Question about super class

#1
[eluser]shinokada[/eluser]
In the system/libraries/Controller.php, it says the following.

/* CodeIgniter Application Controller Class
*
* This class object is the super class that every library in
* CodeIgniter will be assigned to.

Q1. Does it mean I don't need to load it, if a class is super class?
Q2. If I extend Controller in applications/libraries/MY_Controller.php, will it be automatically loaded?


Thanks in advance.

#2
[eluser]jedd[/eluser]
Hi shinokada and welcome to the CI forums,

[quote author="shinokada" date="1253992378"]
Q1. Does it mean I don't need to load it, if a class is super class?
[/quote]

Yes, you don't need to explicitly load it anywhere (ignoring the effect of the parent and extends constructs).

Quote:Q2. If I extend Controller in applications/libraries/MY_Controller.php, will it be automatically loaded?

MY_Controller - assuming you keep the MY_ prefix as defined in your config - will be looked-for, and loaded automagically. Your Controllers will then need to extend and call MY_Controller as their parent, though, of course.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.