Browse Source

Fixes #1643: Added default value for `Captcha::options`

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
4148912b82
  1. 1
      apps/advanced/frontend/views/site/contact.php
  2. 1
      apps/basic/views/site/contact.php
  3. 1
      framework/CHANGELOG.md
  4. 4
      framework/yii/captcha/Captcha.php

1
apps/advanced/frontend/views/site/contact.php

@ -26,7 +26,6 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'subject') ?>
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?>
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
'options' => ['class' => 'form-control'],
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
]) ?>
<div class="form-group">

1
apps/basic/views/site/contact.php

@ -34,7 +34,6 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'subject') ?>
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?>
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
'options' => ['class' => 'form-control'],
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
]) ?>
<div class="form-group">

1
framework/CHANGELOG.md

@ -39,6 +39,7 @@ Yii Framework 2 Change Log
- Enh: Support for file aliases in console command 'message' (omnilight)
- Enh: Sort and Pagination can now create absolute URLs (cebe)
- Chg #1610: `Html::activeCheckboxList()` and `Html::activeRadioList()` will submit an empty string if no checkbox/radio is selected (qiangxue)
- Chg #1643: Added default value for `Captcha::options` (qiangxue)
- Chg: Renamed `yii\jui\Widget::clientEventsMap` to `clientEventMap` (qiangxue)
- Chg: Renamed `ActiveRecord::getPopulatedRelations()` to `getRelatedRecords()` (qiangxue)
- Chg: Renamed `attributeName` and `className` to `targetAttribute` and `targetClass` for `UniqueValidator` and `ExistValidator` (qiangxue)

4
framework/yii/captcha/Captcha.php

@ -48,6 +48,10 @@ class Captcha extends InputWidget
* while `{input}` will be replaced with the text input tag.
*/
public $template = '{image} {input}';
/**
* @var array the HTML attributes for the input tag.
*/
public $options = ['class' => 'form-control'];
/**
* Initializes the widget.

Loading…
Cancel
Save