helper files in component

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
madsamurai
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue Oct 02, 2007 6:13 pm

helper files in component

Post by madsamurai » Fri Mar 14, 2008 7:14 am

I can't seem to find any documentation about how to properly include helper files in J1.5 components. Is it as simple as a require_once() statement? Do the classes in the helper file require any special naming convention, and can there be more than one class in a helper file, or do I need a helper file for each class? And finally, how is the helper and it's classes instantiated in the script? Basically, I have a number of functions I need to re-use in multiple areas of my component, and also I have some special-purpose, non-joomla classes I need to import.

Also, along the same line of thought, I would like to import a config.php file, similar to the main configuration.php, in my component (primarily because I need to set some paths differently for my local development and live webserver). I just need a list of variable declarations. I'm sure this is done in the same way as helper files, but haven't had any luck getting it to work in my experimentations.

Thanks

Post Reply