1

I am trying this code in my module but getting error

jimport('joomla.application.component.model');
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_idlmessaging/models','IdlmessagingModel');
$questionmodel = JModelLegacy::getInstance('Question', 'IdlmessagingModel');
$questionid = '2'; //We used here '1' article id
$question= $questionmodel->getData($questionid );

Error: "Call to a member function getData on boolean"

1

Try this:

JLoader::import('question', JPATH_ROOT.'/components/com_idlmessaging/models');
$questionmodel = JModelLegacy::getInstance('Question', 'IdlmessagingModel');
$questionid = '2'; //We used here '1' article id
$question= $questionmodel->getData($questionid );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.