fix links to search results for #15
This commit is contained in:
parent
5f1a88d752
commit
36cc7f801f
@ -34,6 +34,7 @@ $web = [
|
||||
'packages' => 'package/index',
|
||||
// mods
|
||||
'submit' => 'mod/create',
|
||||
'cloud' => 'mod/cloud',
|
||||
'mods/update/<name:\w+>' => 'mod/update',
|
||||
'mods/<name:\w+>' => 'mod/view',
|
||||
'mods' => 'mod/index',
|
||||
|
@ -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']++;
|
||||
|
@ -17,6 +17,9 @@ use yii\helpers\Html;
|
||||
|
||||
<?php
|
||||
echo $form->field($model, 'search', [
|
||||
'inputOptions' => [
|
||||
'name' => 'search',
|
||||
],
|
||||
'addon' => [
|
||||
'append' => [
|
||||
'content' => Html::submitButton('<i class="glyphicon glyphicon-search"></i>', ['class' => 'btn btn-primary']),
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use app\widgets\TagCloud;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $keywords array */
|
||||
@ -12,6 +13,8 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="mod-cloud">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?php
|
||||
echo TagCloud::widget([
|
||||
'tags' => $keywords,
|
||||
|
Loading…
x
Reference in New Issue
Block a user