/** * Lists all Catalog models. * @return mixed */ public function actionIndex() { $searchModel = new CatalogSearch(); //$dataProvider = $searchModel->search(Yii::$app->request->queryParams); //var_dump(Catalog::find()->all());die(); $dataProvider = Catalog::get(0, Catalog::find()->all()); //var_dump($dataProvider);die(); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
editor = K.create('textarea[name="content"]', { allowFileManager : true }); }); JS; $this->registerJs($js, View::POS_END); ?> <div class="catalog-form"> <?php $form = ActiveForm::begin(['options' => ['class' => 'form-horizontal', 'enctype' => 'multipart/form-data'], 'fieldConfig' => ['template' => "{label}\n<div class=\"col-lg-3\">{input}{hint}</div>\n<div class=\"col-lg-8\">abc{error}</div>", 'labelOptions' => ['class' => 'col-lg-1 control-label']]]); ?> <?php echo $form->field($model, 'parent_id')->dropDownList(ArrayHelper::merge([0 => Yii::t('app', 'Root Catalog')], ArrayHelper::map(Catalog::get(0, Catalog::find()->all()), 'id', 'str_label'))); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 255])->hint('test'); ?> <?php echo $form->field($model, 'brief')->textInput(['maxlength' => 1022]); ?> <!--<?php /*= $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), [ 'options' => [ 'id' => 'content', ],
editor = K.create('textarea[name="content"]', { allowFileManager : true }); }); JS; $this->registerJs($js, View::POS_END); ?> <div class="show-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'catalog_id')->dropDownList(ArrayHelper::map(Catalog::get(0, Catalog::find()->all()), 'id', 'str_label')); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'brief')->textInput(['maxlength' => 1022]); ?> <?php echo $form->field($model, 'content')->textArea(['name' => 'content', 'style' => 'width:800px;height:400px;visibility:hidden;']); ?> <?php