I am taking the Yii2 PHP framework course and I encountered a problem. I'm not very familiar with PHP so I'm having a hard time figuring this out.
So I tried to create a "Delete" button in my website but I got the error: "Cannot use positional parameters after named parameters".
There are code snippets:
'class' => 'yii\grid\ActionColumn', 'buttons' => [ 'delete' => function ($url) { return Html::a(text:'Delete', $url, [ 'data-method' => 'post' ]); } ]
P粉3331862852024-03-27 10:57:44
This is not a Yii2 issue, if you check the php documentation page it talks about this case, it says:
This makes sense, if PHP lets you put named parameters first and then positional parameters, there's no way to determine which parameters should match the unnamed parameters you actually pass.
In the opposite case, the first positional argument root