Merge branch 'master' of github.com:yiisoft/yii2 into sphinx

This commit is contained in:
Klimov Paul
2013-11-17 14:02:29 +02:00
40 changed files with 694 additions and 133 deletions

View File

@@ -48,7 +48,7 @@ use yii\helpers\Html;
* 'bars' => [
* ['percent' => 30, 'options' => ['class' => 'bar-danger']],
* ['percent' => 30, 'label' => 'test', 'options' => ['class' => 'bar-success']],
* ['percent' => 35, 'options' => array['class' => 'bar-warning']],
* ['percent' => 35, 'options' => ['class' => 'bar-warning']],
* ]
* ]);
* ```

View File

@@ -115,11 +115,16 @@ class Generator extends \yii\gii\Generator
*/
public function autoCompleteData()
{
return [
'tableName' => function () {
return $this->getDbConnection()->getSchema()->getTableNames();
},
];
$db = $this->getDbConnection();
if ($db !== null) {
return [
'tableName' => function () use ($db) {
return $db->getSchema()->getTableNames();
},
];
} else {
return [];
}
}
/**

View File

@@ -6,7 +6,17 @@ and makes using JQuery UI widgets in Yii applications extremely easy. For exampl
single line of code in a view file would render a JQuery UI DatePicker widget:
```php
<?= yii\jui\DatePicker::widget(['name' => 'start']) ?>
<?= yii\jui\DatePicker::widget(['name' => 'attributeName']) ?>
```
Configuring the Jquery UI options should be done using the clientOptions attribute:
```php
<?= yii\jui\DatePicker::widget(['name' => 'attributeName', 'clientOptions' => ['dateFormat' => 'yy-mm-dd']]) ?>
```
If you want to use the JUI widget in an ActiveRecord form, it can be done like this:
```php
<?= $form->field($model,'attributeName')->widget(DatePicker::className(),['clientOptions' => ['dateFormat' => 'yy-mm-dd']]) ?>
```

View File

@@ -17,9 +17,9 @@ use yii\mail\BaseMailer;
* To use Mailer, you should configure it in the application configuration like the following,
*
* ~~~
* 'components' => array(
* 'components' => [
* ...
* 'email' => array(
* 'email' => [
* 'class' => 'yii\swiftmailer\Mailer',
* 'transport' => [
* 'class' => 'Swift_SmtpTransport',
@@ -29,9 +29,9 @@ use yii\mail\BaseMailer;
* 'port' => '587',
* 'encryption' => 'tls',
* ],
* ),
* ],
* ...
* ),
* ],
* ~~~
*
* You may also skip the configuration of the [[transport]] property. In that case, the default