Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Yii2:如何发送不';我不属于那种模式_Php_Forms_Yii2 - Fatal编程技术网

Php Yii2:如何发送不';我不属于那种模式

Php Yii2:如何发送不';我不属于那种模式,php,forms,yii2,Php,Forms,Yii2,我需要从视图向控制器发送一个表单,以及一个不属于该模型的数组 我总是使用以下句子发送我的表格: <?= Html::submitButton('Send') ?> 现在我还需要发送一个名为colors的数组,您可以在表单中添加所需的所有字段 <input type='text' class='form-control' name = 'yourname[your_index]' > 在$post中,您可以使用 $model->load($post

我需要从视图向控制器发送一个表单,以及一个不属于该模型的数组

我总是使用以下句子发送我的表格:

<?= Html::submitButton('Send') ?>


现在我还需要发送一个名为colors

的数组,您可以在表单中添加所需的所有字段

<input type='text' class='form-control'  name = 'yourname[your_index]'  >
在$post中,您可以使用

    $model->load($post)
与模型无关的值位于中

$post[yourname[your_index]] 
$post[yourname[your_index]]