Skip to main content
9 votes

Why do we need a system autoloader when we are all ready using Composer autoloading?

My understanding of autoloading is fairly rudimentary but since this has 4 votes and no answers I think I will give it a shot. Please more knowledgeable types add corrections or a better answer etc. ...
jamesgarrett's user avatar
  • 3,299
5 votes

Why do we need a system autoloader when we are all ready using Composer autoloading?

James did a good differentiator between the composer autoloader and JLoader. I think the other thing that your missing here is that JLoader massively predates composer existing (and even when composer ...
George Wilson's user avatar
3 votes

Register Plugin/Class Joomla

As mentioned in the comments, normally you should not use plugin objects directly. But if you need it for some reason, the correct way is using Joomla\CMS\Extension\ExtensionManagerInterface::...
Sharky's user avatar
  • 11.5k
3 votes
Accepted

Proper way for autoloading in Joomla 4

This should still work in 4.0 but will break in 5.0. You are advised to use fully qualified class names. Remove JLoader::register() call and instead add a use statement: use Joomla\Component\Fields\...
Sharky's user avatar
  • 11.5k
2 votes
Accepted

Extend an administrator class in the front end code

JLoader::import() is generally meant for files that follow a certain naming convention. You can still use it as it will fall back to the specified filename, but you have to pass the basepath as the ...
Sharky's user avatar
  • 11.5k
2 votes

How to include an external helper php file in module

If you're getting undefined method error, it means your class is found but you're calling a non-existing method. JLoader::import() first argument accepts dot-separated path with last element used as ...
Sharky's user avatar
  • 11.5k
2 votes
Accepted

Register Plugin/Class Joomla

For having and working with a plugin in a module of Joomla directly (not via events), for testing this let's say you have your own plugin group called: 'myplug' and your plugin is called: 'testplugin1'...
Zollie's user avatar
  • 2,946
1 vote

How to include an external helper php file in module

Thanks for pointing me in the write direction. The problem was between my keyboard and my chair. After staring at the code and seeing the function definition clearly there in the admin helper, and ...
Chris Paschen's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible