Commit 5cb2ce49 by Qiang Xue

Fixes #3665: Better default behavior for ModelSearch generated by the crud generator

parent 9415c792
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $user common\models\User */
$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]);
?>
Hello <?= Html::encode($user->username) ?>,
Hello <?= $user->username ?>,
Follow the link below to reset your password:
......
......@@ -5,6 +5,7 @@ Yii Framework 2 gii extension Change Log
-----------------------
- Bug #6463: The Gii controller generator generates incorrect controller namespace (pana1990)
- Enh #3665: Better default behavior for ModelSearch generated by the crud generator (qiangxue, mdmunir)
2.0.1 December 07, 2014
......
......@@ -69,7 +69,11 @@ class <?= $searchModelClass ?> extends <?= isset($modelAlias) ? $modelAlias : $m
'query' => $query,
]);
if (!($this->load($params) && $this->validate())) {
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment