Browse Source

Fixed search form.

tags/2.0.0-alpha
Qiang Xue 11 years ago
parent
commit
293cb9d86f
  1. 5
      framework/yii/gii/generators/crud/templates/views/_search.php
  2. 2
      framework/yii/grid/DataColumn.php
  3. 2
      framework/yii/helpers/BaseHtml.php
  4. 1
      framework/yii/web/Request.php

5
framework/yii/gii/generators/crud/templates/views/_search.php

@ -23,7 +23,10 @@ use yii\widgets\ActiveForm;
<div class="<?php echo Inflector::camel2id(StringHelper::basename($generator->modelClass)); ?>-search">
<?php echo '<?php'; ?> $form = ActiveForm::begin(array('method' => 'get')); ?>
<?php echo '<?php'; ?> $form = ActiveForm::begin(array(
'action' => array('index'),
'method' => 'get',
)); ?>
<?php
$count = 0;

2
framework/yii/grid/DataColumn.php

@ -73,7 +73,7 @@ class DataColumn extends Column
* the [[filter]] property. When [[filter]] is not set or is an array, this property will be used to
* render the HTML attributes for the generated filter input fields.
*/
public $filterInputOptions = array('class' => 'form-control');
public $filterInputOptions = array('class' => 'form-control', 'id' => null);
protected function renderHeaderCellContent()

2
framework/yii/helpers/BaseHtml.php

@ -237,7 +237,7 @@ class BaseHtml
$hiddenInputs[] = static::hiddenInput($request->restVar, $method);
$method = 'post';
}
if ($request->enableCsrfValidation) {
if ($request->enableCsrfValidation && !strcasecmp($method, 'post')) {
$hiddenInputs[] = static::hiddenInput($request->csrfVar, $request->getCsrfToken());
}
}

1
framework/yii/web/Request.php

@ -77,6 +77,7 @@ class Request extends \yii\base\Request
*/
const CSRF_HEADER = 'X-CSRF-Token';
/**
* @var boolean whether to enable CSRF (Cross-Site Request Forgery) validation. Defaults to true.
* When CSRF validation is enabled, forms submitted to an Yii Web application must be originated

Loading…
Cancel
Save