コード例 #1
0
 public function actionUpdate($id)
 {
     $this->fieldGroup->scenario = 'admin-update';
     if ($this->fieldGroup->load(Yii::$app->request->post())) {
         if ($this->fieldGroup->save()) {
             return $this->redirect(Url::toRoute('index'));
         }
     }
     return $this->render('update', ['model' => $this->fieldGroup]);
 }
コード例 #2
0
ファイル: common.php プロジェクト: nanodesu88/easyii
?>

<?php 
echo $form->field($model, 'show_unit')->checkbox();
?>

<?php 
echo $form->field($model, 'type')->dropDownList(CategoryField::types());
?>

<?php 
echo $form->field($model, 'options')->textarea(['rows' => 6]);
?>

<?php 
echo $form->field($model, 'group_id')->dropDownList(\yii\helpers\ArrayHelper::map(CategoryFieldGroup::find()->all(), 'id', 'title_system'));
?>

<?php 
echo $form->field($model, 'required')->checkbox();
?>

<?php 
echo $form->field($model, 'hidden')->checkbox();
?>

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

<?php 
コード例 #3
0
ファイル: common.php プロジェクト: nanodesu88/easyii
<?php

use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
/**
 * @var \yii\easyii\modules\catalog\models\Category2CategoryField $model
 */
?>

<?php 
$form = ActiveForm::begin([]);
echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(\yii\easyii\modules\catalog\models\Category::find()->all(), 'id', 'title'));
?>

<?php 
echo $form->field($model, 'field_group_id')->dropDownList(ArrayHelper::map(\yii\easyii\modules\catalog\models\CategoryFieldGroup::find()->all(), 'id', 'title_system'));
?>


<?php 
echo Html::submitButton(Yii::t('easyii', 'Save'), ['class' => 'btn btn-primary']);
?>

<?php 
ActiveForm::end();