예제 #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;
 }
예제 #2
0
파일: Post.php 프로젝트: abwxwx/yiistudy
 /**
  * Normalizes the user-entered tags.
  */
 public function normalizeTags($attribute, $params)
 {
     $this->tags = Tag::array2string(array_unique(Tag::string2array($this->tags)));
 }