예제 #1
0
 public function init()
 {
     parent::init();
     $tag = new Tag();
     $tags = $tag->findTagWeights($this->max);
     foreach ($tags as $tag => $weight) {
         $link = Html::a(Html::encode($tag), ['post/index', 'tag' => $tag]);
         echo Html::tag('span', $link, ['class' => 'tag', 'style' => "font-size:{$weight}pt"]) . "\n";
     }
 }
예제 #2
0
 /**
  * Displays a post detail.
  * @param integer $id
  * @return mixed
  */
 public function actionDetail($id)
 {
     $postModel = new Comment();
     if ($postModel->load(Yii::$app->request->post())) {
         $postModel->status = Comment::STATUS_PENDING;
         $postModel->post_id = $id;
         if ($postModel->save()) {
             $this->added = 1;
         }
     }
     $tags = Tag::findTagWeights(Yii::$app->params['tagCloudCount']);
     $commentModel = new Comment();
     $commentDataProvider = $commentModel->findRecentComments(Yii::$app->params['recentCommentCount']);
     //Yii::$app->params['recentCommentCount']
     return $this->render('detail', ['model' => $this->findModel($id), 'commentDataProvider' => $commentDataProvider, 'tags' => $tags, 'postModel' => $postModel, 'added' => $this->added]);
 }
예제 #3
0
/**
 * @var \yii\web\View $this
 * @var \yii\gii\Generator[] $generators
 * @var \yii\gii\Generator $activeGenerator
 * @var string $content
 */
//$activeGenerator = Yii::$app->controller->generator;
$activeGenerator = isset($_GET['id']) ? $_GET['id'] : '1';
/***分类总数****/
$category = Yii::$app->controller->category();
/**分类名称获取 继承自BaseModel**/
$humourClassify = Humour::humourClassify();
/*热门文章*/
$hotPosts = Humour::getHotPosts();
/*热门标签*/
$tags = Tag::findTagWeights(20, 'humour');
$this->beginContent('@app/views/layouts/main.php');
//$this->beginContent('@app/views/layouts/main.php');
?>
<style type="text/css">
.list-group .glyphicon {
        float: right;
}
</style>
<div class="row">
    <div class="col-md-9 col-sm-8">
        <?php 
echo $content;
?>
    </div>
예제 #4
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use app\models\Tag;
?>

<div class="panel panel-default">
    <div class="panel-heading">Tags</div>
    <div class="panel-body">
        <?php 
foreach (Tag::findTagWeights() as $tag => $weight) {
    $link = Url::toRoute(['book/index', 'tag' => $tag]);
    echo Html::tag('a', $tag, array('style' => "font-size:{$weight}pt", 'href' => $link)) . "\n";
}
?>
    </div>
</div>
예제 #5
0
/**
 * @var \yii\web\View $this
 * @var \yii\gii\Generator[] $generators
 * @var \yii\gii\Generator $activeGenerator
 * @var string $content
 */
//$activeGenerator = Yii::$app->controller->generator;
$activeGenerator = isset($_GET['id']) ? $_GET['id'] : '1';
/***分类总数****/
$category = Yii::$app->controller->category();
/**分类名称获取 继承自BaseModel**/
$topicClassify = TopicAdmin::topicClassify();
/*热门文章*/
$hotPosts = TopicAdmin::getHotPosts();
/*热门标签*/
$tags = Tag::findTagWeights(20, 'topic');
$this->beginContent('@app/views/layouts/main.php');
//$this->beginContent('@app/views/layouts/main.php');
?>
<style type="text/css">
.list-group .glyphicon {
        float: right;
}
</style>
<div class="row">
    <div class="col-md-9 col-sm-8">
        <?php 
echo $content;
?>
    </div>
예제 #6
0
/**
 * @var \yii\web\View $this
 * @var \yii\gii\Generator[] $generators
 * @var \yii\gii\Generator $activeGenerator
 * @var string $content
 */
//$activeGenerator = Yii::$app->controller->generator;
$activeGenerator = isset($_GET['id']) ? $_GET['id'] : '1';
/***分类总数****/
$category = Yii::$app->controller->category();
/**分类名称获取 继承自BaseModel**/
$musicClassify = Music::musicClassify();
/*热门文章*/
$hotPosts = Music::getHotPosts();
/*热门标签*/
$tags = Tag::findTagWeights(20, 'music');
$this->beginContent('@app/views/layouts/main.php');
//$this->beginContent('@app/views/layouts/main.php');
?>
<style type="text/css">
.list-group .glyphicon {
        float: right;
}
</style>
<div class="row">
    <div class="col-md-9 col-sm-8">
        <?php 
echo $content;
?>
    </div>