当前位置: 首页>>代码示例>>PHP>>正文


PHP Tag::findTagWeights方法代码示例

本文整理汇总了PHP中app\models\Tag::findTagWeights方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::findTagWeights方法的具体用法?PHP Tag::findTagWeights怎么用?PHP Tag::findTagWeights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Tag的用法示例。


在下文中一共展示了Tag::findTagWeights方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 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";
     }
 }
开发者ID:rocketyang,项目名称:dcms2,代码行数:10,代码来源:TagCloud.php

示例2: actionDetail

 /**
  * 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]);
 }
开发者ID:grutabow,项目名称:Yii2Blog,代码行数:21,代码来源:PostController.php

示例3: isset

/**
 * @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>
开发者ID:sayi21cn,项目名称:yt-for-coding,代码行数:30,代码来源:right_humour.php

示例4: array

<?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>
开发者ID:CrystalEller,项目名称:yii2ebooks,代码行数:18,代码来源:tag-cloud.php

示例5: isset

/**
 * @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>
开发者ID:sayi21cn,项目名称:yt-for-coding,代码行数:30,代码来源:right_topic.php

示例6: isset

/**
 * @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>
开发者ID:sayi21cn,项目名称:yt-for-coding,代码行数:30,代码来源:right_music.php


注:本文中的app\models\Tag::findTagWeights方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。