yii2中的多个动态形式

时间:2015-12-03 06:36:43

标签: yii2 yii2-advanced-app yii2-basic-app

大家好我想在set([5,6])== set([5,6])&set([4,'a',3,5,6]) True 中实施this widget,但我遇到创建第二种形式的问题。我不确定我应该在yii2字段中传递什么

我尝试将models传递给第一个动态表单(工作正常)但是当我在同一页面中传递$modelsAddress[0]第二个动态表单时,它会抛出错误。这是我的视图文件代码

$modelsAddress[1]

这全部包含在相同的 <?php DynamicFormWidget::begin([ 'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_] 'widgetBody' => '.container-items', // required: css class selector 'widgetItem' => '.item', // required: css class 'limit' => 4, // the maximum times, an element can be cloned (default 999) 'min' => 1, // 0 or 1 (default 1) 'insertButton' => '.add-item', // css class 'deleteButton' => '.remove-item', // css class 'model' => $modelsRegistration[0], 'formId' => 'riders-form', 'formFields' => [ 'rider_id', 'horse_id', ], ]); ?> //body element goes here <?php DynamicFormWidget::end(); ?> //Second form starts here <?php DynamicFormWidget::begin([ 'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_] 'widgetBody' => '.container-items1', // required: css class selector 'widgetItem' => '.item1', // required: css class 'limit' => 4, // the maximum times, an element can be cloned (default 999) 'min' => 0, // 0 or 1 (default 1) 'insertButton' => '.add-item1', // css class 'deleteButton' => '.remove-item1', // css class 'model' => $modelsRegistration[1], 'formId' => 'riders-form', 'formFields' => [ 'rider_id', 'horse_id', ], ]); ?> //body element goes here <?php DynamicFormWidget::end(); ?> Activeform行抛出错误

我应该如何创建模型数组?

0 个答案:

没有答案