コード例 #1
0
ファイル: TagsWidget.php プロジェクト: knyazushka/z34lot.new
 public function run()
 {
     $tags = Tag::findTagWeights();
     $str = '';
     foreach ($tags as $tag => $weight) {
         $link = Html::a(Html::encode($tag), Yii::$app->getUrlManager()->createUrl(['main/default/index', 'tag' => $tag]));
         $str .= Html::tag('span', $link, ['class' => 'tag', 'style' => "font-size:{$weight}pt"]) . "\n";
     }
     return $this->render('tag', ['title' => $this->title, 'content' => $str]);
 }