public function get() { //init variable $app = JFactory::getApplication(); //get data $catid = $app->input->get('id', 0, 'INT'); $limitstart = $app->input->get('limitstart', 0, 'INT'); $limit = $app->input->get('limit', 10, 'INT'); $cat_obj = new CategoriesModelCategories(); $jlist = new JModelList(); $config = JFactory::getConfig(); $old_limit = $config->get('list_limit'); $config->set('list_limit', 0); //$jlist->setState('list.start', 0); //$jlist->setState('list.limit', 10); //print_r($config);die("in api"); $rows = $cat_obj->getItems(); $items = array(); //format data $obj = new BlogappSimpleSchema(); foreach ($rows as $row) { $items[] = $obj->mapCategory($row); } $config->set('list_limit', $old_limit); $items = array_slice($items, $limitstart, $limit); $this->plugin->setResponse($items); }
/** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JController * @since 1.6 */ public function __construct($config = array()) { parent::__construct($config); }