Yii2 Kartik EditableColumn ajax发布网址不会更改

时间:2017-08-15 09:36:07

标签: ajax yii2 editablegrid

这是gridview的列之一。这是它给我的网址http://localhost/testing/apps/web/op/details/listing/particular

我想要的网址是

http://localhost/testing/apps/modules/op/controllers/listing/particular

我试过

'formOptions' => [ 'action' => ['/listing/particular'] ],

'formOptions' => [ 'action' => ['../listing/particular'] ],

'formOptions' => [ 'action' => ['apps/modules/op/controllers/listing/particular'] ],

问题是无论我如何修改网址,它都会继续附加我在http://localhost/testing/apps/web/(what i type)后面输入的内容 反正有没有删除web的东西?

[
        'class'=>'\kartik\grid\EditableColumn',
        'attribute'=>'particular',
       'editableOptions' =>
        [
            'inputType' => Editable::INPUT_TEXT,
            'formOptions' => [ 'action' => ['listing/particular'] ],
            'options' => [

            ]
        ]
    ],

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用yii\helpers\Url

use yii\helpers\Url;
Url::toRoute(['listing/particular'])