唯_爱 2020-02-19 11:51:52 2243次浏览 1条回复 0 0 0

正常编辑 template 更改$url 会由当前域名路由更改为所写路由如:/shop-goods-class/index 框架携带参数为 id 生成操作 shop-goods-class/index?id=XX

['class' => 'yii\grid\ActionColumn','header'=>'操作','template' => '{/shop-goods-class/index} {view} {update} {delete}',
    'buttons' => [
        '/shop-goods-class/index' => function ($url, $model, $key) {
            return  Html::a('<span class="glyphicon glyphicon-plusm">产品管理</span>', $url, ['title' => '产品管理'] ) ;
        },
    ],
],

如想把 shop-goods-class/index?id=XX 变为 shop-goods-class/index?xx=XX 或者 shop-goods-class/index?xx=XX&xx=xx

['class' => 'yii\grid\ActionColumn','header'=>'操作','template' => '{/shop-goods-class/index} {view} {update} {delete}',
    'buttons' => [
        '/shop-goods-class/index' => function ($url, $model, $key) {
            $url = "/shop-goods-class/index?shop_id=$model->id";
            return  Html::a('<span class="glyphicon glyphicon-plusm">产品管理</span>', $url, ['title' => '产品管理'] ) ;
        },
    ],
],
  • 回复于 2020-02-19 15:19 举报

    我记得 from表单有一个提交方式的 默认是post 你改成get 应该就是你想要的了

    1 条回复
    回复于 2020-02-21 21:35 回复

    不是from提交;是页面跳转pjax的属性问题。不是同一个模块下。页面没有刷新

您需要登录后才可以回复。登录 | 立即注册