Ejemplo n.º 1
0
 /**
  * @return array a list of links that point to the post list filtered by every tag of this post
  */
 public function getTagLinks()
 {
     $links = [];
     foreach (Tag::string2array($this->tags) as $tag) {
         $links[] = Html::a($tag, Yii::$app->getUrlManager()->createUrl(["home/index&PostSearch[tags]={$tag}"]));
     }
     return $links;
 }
Ejemplo n.º 2
0
 /**
  * Normalizes the user-entered tags.
  */
 public function normalizeTags($attribute, $params)
 {
     $this->tags = Tag::array2string(array_unique(Tag::string2array($this->tags)));
 }