0
我是一個新的yii2開發人員。我想使用小部件而不是activeForms。但是,我不知道該怎麼做。請給我提示如何使用小部件。 在我的文件,我有以下代碼:使用小部件而不是活動形式在yii2
<div class="">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'title_ru')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description_ru')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'content_ru')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'type')->textInput() ?>
<?= $form->field($model, 'region')->textInput() ?>
<?= $form->field($model, 'category')->textInput() ?>
<?= $form->field($model, 'status')->textInput() ?>
<?= $form->field($model, 'image')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'title_en')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'title_uz')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'title_uzk')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description_en')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description_uz')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description_uzk')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'content_en')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'content_uz')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'content_uzk')->textarea(['rows' => 6]) ?>
<?php ActiveForm::end(); ?>
</div>
//學習部件
部件的你有什麼到目前爲止已經試過? – vishuB