Here are some basic notes on how I accomplished this:
I’m using a file called loader.php located in the library path in my component Directory. I call it from my main controller file like this:
in my loader PHP I have this line:
As you can see I just copied the PFBC folder into a folder called 3rdparty within my Joomla component folder. Now you can use PFBC anywhere in your component by creating the object like this and add a field for example:
$form = new Form("testing", 300) ; $form->addElement(new Element_Textbox("My Textbox:", "MyTextbox")); $form->addElement(new Element_Button);
Assign it to the View as usual:
And render it in the tmpl file:
$mod = &JModuleHelper::getModule('custom', 'Custom HTML'); echo JModuleHelper::renderModule($mod);
I have this piece of code in my default.php file within my views/default/tmpl/ folder. The ‘custom’ refers to the module mod_custom and ‘Custom HTML’ specifies which of the mod_custom modules to call.
$mod = &JModuleHelper::getModule('custom', 'MODULEA'); echo JModuleHelper::renderModule($mod); $mod = &JModuleHelper::getModule('custom', 'MODULEB'); echo JModuleHelper::renderModule($mod);
- At the time of writing I’m using Joomla 1.7
- The modules HAS to be published.
- It needs to be assigned to the pages/menus you want it to display.