From 36cc7f801f324281105cdc93dca6cfe7c6f0bbfc Mon Sep 17 00:00:00 2001 From: cornernote Date: Tue, 11 Aug 2015 23:20:39 +0930 Subject: [PATCH] fix links to search results for #15 --- src/config/main.php | 1 + src/controllers/ModController.php | 4 ++-- src/views/mod/_search.php | 3 +++ src/views/mod/cloud.php | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/config/main.php b/src/config/main.php index d73947d..e667a7c 100644 --- a/src/config/main.php +++ b/src/config/main.php @@ -34,6 +34,7 @@ $web = [ 'packages' => 'package/index', // mods 'submit' => 'mod/create', + 'cloud' => 'mod/cloud', 'mods/update/' => 'mod/update', 'mods/' => 'mod/view', 'mods' => 'mod/index', diff --git a/src/controllers/ModController.php b/src/controllers/ModController.php index 202a535..2f4639d 100644 --- a/src/controllers/ModController.php +++ b/src/controllers/ModController.php @@ -25,7 +25,7 @@ class ModController extends Controller public function actionIndex() { $searchModel = new PackageSearch(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + $dataProvider = $searchModel->search(['PackageSearch' => Yii::$app->request->queryParams]); return $this->render('index', [ 'searchModel' => $searchModel, @@ -108,7 +108,7 @@ class ModController extends Controller $keywords[$keyword] = [ 'text' => $keyword, 'weight' => 0, - 'link' => Url::to(['/mods/search', 'keyword' => $keyword]), + 'link' => Url::to(['/mod/index', 'search' => $keyword]), ]; } $keywords[$keyword]['weight']++; diff --git a/src/views/mod/_search.php b/src/views/mod/_search.php index 886eef1..bf45f7e 100644 --- a/src/views/mod/_search.php +++ b/src/views/mod/_search.php @@ -17,6 +17,9 @@ use yii\helpers\Html; field($model, 'search', [ + 'inputOptions' => [ + 'name' => 'search', + ], 'addon' => [ 'append' => [ 'content' => Html::submitButton('', ['class' => 'btn btn-primary']), diff --git a/src/views/mod/cloud.php b/src/views/mod/cloud.php index 3156175..aa1ec4f 100644 --- a/src/views/mod/cloud.php +++ b/src/views/mod/cloud.php @@ -1,6 +1,7 @@ params['breadcrumbs'][] = $this->title; ?>
+

title) ?>

+ $keywords,