I am working on a custom joomla component and have a single view setup. I am trying to figure out how to pull a list of k2 items into the view based on a few custom filters...
In weird english it would something like this:
Get all k2 items that_match_some_requirements into my custom components view where user_id = this user
It would be nice to be able to reference the item data normally like so:
$this->item->info
I am really just trying to understand / figure out the best way to import k2 item's and their object into my components view. If that makes sense?
Maybe something with this? Although I feel the name indicates otherwise :-/
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_component/models');
$whateverModel = JModelLegacy::getInstance('something', 'something'); //? not sure
or maybe from this module code?
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php');
class modK2ContentHelper
{
public static function getItems(&$params, $format = 'html')
{
jimport('joomla.filesystem.file');
$mainframe = JFactory::getApplication();
$limit = $params->get('itemCount', 5);
$cid = $params->get('category_id', NULL);
$ordering = $params->get('itemsOrdering', '');
$componentParams = JComponentHelper::getParams('com_k2');
$limitstart = JRequest::getInt('limitstart');
Thank you!