function categories() { list($params, $id) = $this->parse_params(func_get_args()); $c = new Category(); $params['auth'] = $this->auth; $params['limit_to'] = 'content'; if (strpos($id, ',') === false) { $final = $c->where_related('content', 'id', $id)->listing($params); } else { $final = $c->get_grouped_status(explode(',', $id), 'Content'); } $this->set_response_data($final); }