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

This commit is contained in:
Qiang Xue
2013-08-17 07:04:01 -04:00
2 changed files with 4 additions and 2 deletions

View File

@ -207,12 +207,12 @@ page. We're using third argument so one of the views could override it.
### Registering scripts
With View object you can register scripts. There are two dedicated methods for it: `registerScript` for inline scripts
With View object you can register scripts. There are two dedicated methods for it: `registerJs` for inline scripts
and `registerJsFile` for external scripts. Inline scripts are useful for configuration and dynamically generated code.
The method for adding these can be used as follows:
```php
$this->registerScript("var options = ".json_encode($options).";", View::POS_END, 'my-options');
$this->registerJs("var options = ".json_encode($options).";", View::POS_END, 'my-options');
```
First argument is the actual code where we're converting a PHP array of options to JavaScript one. Second argument

View File

@ -262,6 +262,7 @@ abstract class Generator extends Model
'break',
'case',
'catch',
'callable',
'cfunction',
'class',
'clone',
@ -297,6 +298,7 @@ abstract class Generator extends Model
'include',
'include_once',
'instanceof',
'insteadof',
'interface',
'isset',
'list',