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!