本文整理匯總了PHP中app\components\Helper::create_keywords方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::create_keywords方法的具體用法?PHP Helper::create_keywords怎麽用?PHP Helper::create_keywords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\components\Helper
的用法示例。
在下文中一共展示了Helper::create_keywords方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeSave
public function beforeSave($insert)
{
if (empty($this->description)) {
$this->description = \app\components\Helper::create_descr($this->title, $this->full);
}
if (empty($this->keywords)) {
$this->keywords = \app\components\Helper::create_keywords($this->title, $this->full);
}
return parent::beforeSave($insert);
}
示例2:
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\modules\category\models\Category */
$this->title = 'Комментарий от ' . $model->username;
// $this->params['breadcrumbs'][] = ['label' => 'Комментарий', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$this->registerMetaTag(['name' => 'description', 'content' => \app\components\Helper::create_descr($this->title, $model->post)]);
$this->registerMetaTag(['name' => 'keywords', 'content' => \app\components\Helper::create_keywords($this->title, $model->post)]);
?>
<div class="">
<h1 class="header"><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['username', ['attribute' => created_at, 'format' => ['date', 'dd.MM.yyyy HH:ss']], 'post']]);
?>
</div>