Reputation: 585
/libraries/joomla/application/component/controller.php
where this file is located in JOOMLA 3.1.5
Upvotes: 0
Views: 1832
Reputation: 3731
In 3.0, it is my understanding that most of the classes autoload, so you can typically guess a files location based on the class name (since this is how the autoloader finds them!). Basically, the prefix is mapped to one or more libraries, and then each word after that represents a folder or file (for the last word of the class). If there is just a prefix and one word (like JController), controller
will be both the folder and file name. Tricky? Some examples:
For these, you should note that the J
prefix is mapped to several libraries: joomla, cms, and legacy.
JControllerLegacy will be defined in either libraries/joomla/controller/legacy.php
, libraries/cms/controller/legacy.php
, or libraries/legacy/controller/legacy.php
. In this case it is the last one, the legacy library.
JController no longer refers to a class but an interface in 3.1, but still it will reside at either libraries/joomla/controller/controller.php
, libraries/cms/controller/controller.php
, or libraries/legacy/controller/controller.php
. In this case it happens to be the first place, the joomla library.
Note in the above how controller is repeated as both the folder and the file name. They don't allow php files in the main library folder (ie. you can't do libraries/joomla/controller.php
, so for short class names, you will see the name doubled.)
Finally, any class that follows this format will be autoloaded by joomla, so there is no need to include a jimport call before using the class.
Upvotes: 2