Retrieving data from an external component

9 years 9 months ago #245572 by t4chyon
As the title suggests, I would like to be able to retrieve data from a component model, and insert it into the body of a new message. As an example, let's say that I want to get all the article categories.

To achieve this, I've modified uddeIMdrawWriteform() to call the model class and insert the value returned by getItems() into the $pmessage parameter of uddeIMdrawWriteform(). Like so:
jimport( 'joomla.application.component.model' );
$categories= JModelLegacy::getInstance('Categories','ContentModel',array('ignore_request' => true));
$categories_result = $categories->getItems();
$pmessage = $categories_result . $pmessage;

The issue here is that getInstance() did not return the model class. Am I still missing something obvious?

Any hints will be much appreciated. Thanks!

Please Log in to join the conversation.

Moderators: beatnantslabbikrileon
Time to create page: 0.142 seconds

Facebook Twitter LinkedIn