public function add_tag() { // Get the application object. $app = JFactory::getApplication(); $tag_id = JRequest::getString("tag_id"); $tag_name = JRequest::getString("tag_name"); $text_id = JRequest::getString("text_id"); //$article_model = $this->getModel('article'); //$tagId = $article_model->addTag($tag_id, $tag_name, $text_id); $tagId = Ideary::addTag($tag_id, $tag_name, $text_id); echo json_encode(array('tag_id' => $tagId)); $app->close(); }