yii2搜索不追加参数方法

2022-01-10 10:46:22 浏览数 (1)

代码语言:javascript复制
<div class="page-select2-area">
    <?php
    $labelOptions = ['labelOptions' => ['class' => false]];
    $form = ActiveForm::begin(['layout' => 'inline', 'method' => 'get', 'action' => ['order-list/'.Yii::$app->controller->action->id]]); ?>
    <?= $form->field($searchModel, 'keyword')->textInput() ?>
        <input type="text" placeholder="商品名称或订单号关键字">
    <button type="submit" class="btn btn-default">搜索</button>
    <?php yiibootstrapActiveForm::end(); ?>
</div>

此处是关键

代码语言:javascript复制
 'action' => ['order-list/'.Yii::$app->controller->action->id]

0 人点赞