From 3d8b147fe676a41191c09cf655a2b13fe69ab17c Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 17 Aug 2013 12:34:39 +0200 Subject: [PATCH 1/2] doc fix in view.md guide registerJS instead of registerScript fixes #774 --- docs/guide/view.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/view.md b/docs/guide/view.md index e3817ee..c9f792b 100644 --- a/docs/guide/view.md +++ b/docs/guide/view.md @@ -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 From 0679d8ca74d4881aea0cbc994f9e4f6df642b620 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 17 Aug 2013 12:39:58 +0200 Subject: [PATCH 2/2] added missing php reserved keywords to gii generator --- framework/yii/gii/Generator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/yii/gii/Generator.php b/framework/yii/gii/Generator.php index 40588d9..db05aa3 100644 --- a/framework/yii/gii/Generator.php +++ b/framework/yii/gii/Generator.php @@ -211,6 +211,7 @@ abstract class Generator extends Model '__line__', '__method__', '__namespace__', + '__trait__', 'abstract', 'and', 'array', @@ -218,6 +219,7 @@ abstract class Generator extends Model 'break', 'case', 'catch', + 'callable', 'cfunction', 'class', 'clone', @@ -242,7 +244,7 @@ abstract class Generator extends Model 'exit', 'extends', 'final', - 'final', + 'finally', 'for', 'foreach', 'function', @@ -253,6 +255,7 @@ abstract class Generator extends Model 'include', 'include_once', 'instanceof', + 'insteadof', 'interface', 'isset', 'list', @@ -273,6 +276,7 @@ abstract class Generator extends Model 'switch', 'this', 'throw', + 'trait', 'try', 'unset', 'use',