我试图通过yii \ bootstrap \ Html发送参数;
echo Html::a('Создать', ['/orders/order-create','freelancer_group'=>$_GET['freelancer_group']], ['class'=>'btn btn-lg btn-primary','data'=>['method' => 'post','derp'=>'herp'],]);
但是当我点击它时,var_dump($_POST['derp']);
仍是NULL
。我该如何发布?我找到了here
答案 0 :(得分:5)
echo Html::a('Создать',
['/orders/order-create', 'freelancer_group' => $_GET['freelancer_group']],
[
'class' => 'btn btn-lg btn-primary',
'data' => [
'method' => 'post',
'params' => ['derp' => 'herp'], // <- extra level
],
]
);