Beispiel #1
0
?>

        <?php 
echo $form->field($model, 'title')->multilingualTextInput(['maxlength' => 255]);
?>
        
        <?php 
echo $form->field($model, 'alias')->textInput(['maxlength' => 255]);
?>
		
		<?php 
echo $form->field($model, 'enabled')->checkbox();
?>

        <?php 
echo $form->field($model, 'parent_id')->dropdownList(ArrayHelper::map(TopMenu::find()->all(), 'id', 'title'), ['prompt' => '']);
?>

        <div class="form-group">
            <div class="col-md-10 col-md-offset-2">
                <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
            </div>
        </div>

        <?php 
ActiveForm::end();
?>

    </div>
Beispiel #2
0
use yii\grid\GridView;
use app\modules\content\widgets\NestableSortableWidget;
use app\modules\content\models\TopMenu;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\content\models\ContentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Menu';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    

    <p>
        <?php 
echo Html::a('Create Menu Item', ['create'], ['class' => 'btn btn-success']);
?>
    </p>



</div>


<?php 
echo NestableSortableWidget::widget(['models' => TopMenu::find()->where(['parent_id' => 0])->orWhere(['parent_id' => null])->sorted()->all(), 'rearrangeAction' => '/admin/content/top-menu/rearrange']);