Skip to Content Skip to Menu

Retrieving data from an external component

  • t4chyon
  • t4chyon
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
10 years 4 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:
Code:
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 or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum