protected function renderContent() { $tags = VideoTag::model()->findTagWeights($this->maxTags); foreach ($tags as $tag => $weight) { $link = CHtml::link(CHtml::encode($tag), array('video/tag', 'tag' => $tag)); echo CHtml::tag('span', array('class' => 'tag', 'style' => "font-size:" . ($weight + 3) . "pt"), $link) . "\n"; } }
/** * This is invoked after the record is deleted. */ protected function afterDelete() { parent::afterDelete(); //Comment::model()->deleteAll('post_id='.$this->id); VideoTag::model()->updateFrequency($this->tags, ''); }
/** * Suggests tags based on the current user input. * This is called via AJAX when the user is entering the tags input. */ public function actionSuggestTags() { if (isset($_GET['q']) && ($keyword = trim($_GET['q'])) !== '') { $tags = VideoTag::model()->suggestTags($keyword); if ($tags !== array()) { echo implode("\n", $tags); } } }