Reputation: 41
In joomla we have api to save article:
require_once (JPATH_BASE.'/administrator/components/com_content/models/article.php');
$new_article = new ContentModelArticle();
$data = array(
'title' => "new article",
'introtext' => "This is new article",
'fulltext' => "The End!",
);
$new_article->save($data);
now i want add tags in my article. #new
#article
#End
How can i do it?
Upvotes: 2
Views: 544
Reputation: 175
Insert the tags in array format.
$new_article->newTags = ['ID_tag_one', 'ID_tag_two', 'etc']; //array of tag IDs
Upvotes: 2