This is probably a really stupid question but I cannot find the answer and trial and error has failed.
I am developing a component for Joomla 3.x and I have a number of classes that I want to use. I am trying to implement the JLoader::registerPrefix()
method. Lets say I have two classes Helper
and NotHelpful
. Helper
is a static class stored at:
JPATH_LIBRARIES . '/foo/bar/Helper.php'
and NotHelpful
is a non static class stored at:
JPATH_LIBRARIES . '/foo/baz/NotHelpful.php'
If I want to register these my understanding is I would call:
JLoader::registerPrefix('Foo', JPATH_LIBRARIES . '/foo');
which I am doing from the entry point to the application.
Then to call Helper
, I would just use FooBarHelper::method1();
or to instantiate a new NotHelpful
would be $Class = new FooBazNotHelpful();
What is unclear to me is what the actual class name inside of Helper.php or NotHelpful.php should be. Should it be FooBarHelper
, Helper
, BarHelper
, or something else entirely?
When I try to call FooBarHelper::method1();
I get the error no matter what my class is named it seems:
PHP Fatal error: Class 'FooBarHelper' not found in
I am clearly doing at least one thing wrong. Can anyone tell me what one or more of them are?