V2CE – yii2搜索不追加参数方法

<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 \yii\bootstrap\ActiveForm::end(); ?>
</div>

此处是关键

 'action' => ['order-list/'.Yii::$app->controller->action->id]

正文完