我只想将 GET-param 从用户添加到 URL。我使用第三方模块操作,所以我不想更改签名
public function actionReset($id, $code)
我在控制器中有这样的模型
$model = new DynamicModel([
'code'
]);
$model->addRule(['code'], 'required');
$model->addRule(['code'], 'string');
诸如此类ActiveForm
<?php $form = ActiveForm::begin([
'method' => 'get',
'action' => [
\yii\helpers\Url::current()
]
]) ?>
<?php echo $form->field($model, 'code')->textInput()->label(false); ?>
<?php echo Html::submitButton(Yii::t('user', 'Continue')); ?>
<?php ActiveForm::end(); ?>
通过这样的实现,它通过一个数组包装器传递:
如果没有自定义 js,是否可以避免这种包装器?