本文整理汇总了PHP中app\components\Helper::create_descr方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::create_descr方法的具体用法?PHP Helper::create_descr怎么用?PHP Helper::create_descr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\components\Helper
的用法示例。
在下文中一共展示了Helper::create_descr方法的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>