mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-16 07:11:19 +08:00
replaced usages of $_GET with Request::queryParams
This commit is contained in:
@ -100,7 +100,7 @@ class Nav extends Widget
|
|||||||
$this->route = Yii::$app->controller->getRoute();
|
$this->route = Yii::$app->controller->getRoute();
|
||||||
}
|
}
|
||||||
if ($this->params === null) {
|
if ($this->params === null) {
|
||||||
$this->params = $_GET;
|
$this->params = Yii::$app->request->getQueryParams();
|
||||||
}
|
}
|
||||||
Html::addCssClass($this->options, 'nav');
|
Html::addCssClass($this->options, 'nav');
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
|
|||||||
public function actionIndex()
|
public function actionIndex()
|
||||||
{
|
{
|
||||||
$searchModel = new <?= isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>;
|
$searchModel = new <?= isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>;
|
||||||
$dataProvider = $searchModel->search($_GET);
|
$dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
|
||||||
|
|
||||||
return $this->render('index', [
|
return $this->render('index', [
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
|
@ -158,7 +158,7 @@ class Menu extends Widget
|
|||||||
$this->route = Yii::$app->controller->getRoute();
|
$this->route = Yii::$app->controller->getRoute();
|
||||||
}
|
}
|
||||||
if ($this->params === null) {
|
if ($this->params === null) {
|
||||||
$this->params = $_GET;
|
$this->params = Yii::$app->request->getQueryParams();
|
||||||
}
|
}
|
||||||
$items = $this->normalizeItems($this->items, $hasActiveChild);
|
$items = $this->normalizeItems($this->items, $hasActiveChild);
|
||||||
$options = $this->options;
|
$options = $this->options;
|
||||||
|
Reference in New Issue
Block a user