Last active
August 29, 2015 14:15
-
-
Save amilabandara/5d6415e706a66e3e35f9 to your computer and use it in GitHub Desktop.
Joomla essentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#set variable from view | |
$this->form->setValue('image_name', null, $this->item->image); | |
#update dropdown | |
$('selector').val('value').trigger("liszt:updated"); | |
#call any model from any component , any location | |
JModelLegacy::addIncludePath (JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_component' . DIRECTORY_SEPARATOR . 'models'); | |
#add jtable if needs to call core functions | |
JTable::addIncludePath(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_component'.DIRECTORY_SEPARATOR.'tables'); | |
#i.e if class name My_ComponentModelProduct break down it as follows | |
$model = JModelLegacy::getInstance('Product', 'My_ComponentModel'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much. working perfectly.