Exemplo n.º 1
0

<?php 
$form = ActiveForm::begin(['id' => 'post-form'], ['enableClientValidation' => true], ['enableAjaxValidation' => true], ['validateOnChange' => true]);
?>

    <?php 
echo $form->field($model, 'title');
?>
    
    <?php 
echo $form->field($model, 'slug');
?>

    <?php 
echo $form->field($model, 'cat_id')->dropDownList(\yii\helpers\ArrayHelper::map(app\modules\category\models\Category::find()->all(), 'id', 'title'));
?>
  

    <?php 
echo $form->field($model, 'short')->textArea(['rows' => 4]);
?>
    <?php 
echo $form->field($model, 'full')->textArea();
?>

    <?php 
echo $form->field($model, 'editorTags')->widget(\sjaakp\taggable\TagEditor::className(), ['tagEditorOptions' => ['autocomplete' => ['source' => Url::toRoute(['tag/suggest'])]]])->label('Теги');
?>

    <?php 
Exemplo n.º 2
0
<?php

use yii\helpers\Html;
use yii\widgets\ListView;
$this->title = $category->title;
$this->params['breadcrumbs'][] = $this->title;
$this->registerMetaTag(['name' => 'keywords', 'content' => $category->keywords]);
$this->registerMetaTag(['name' => 'description', 'content' => $category->description]);
?>



<h1><?php 
echo $this->title;
?>
</h1>

<?php 
echo yii\bootstrap\Nav::widget(['options' => ['class' => 'nav nav-tabs nav-justified'], 'items' => app\modules\category\models\Category::getMenuItems()]);
?>


 <div class="widget ads">

        <?php 
echo ListView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'itemView' => '_index_item', 'options' => ['class' => 'blog'], 'itemOptions' => ['class' => 'blog-item', 'tag' => 'article']]);
?>
 

</div>