From ad479dd7f65d7701848968c9ba2169042b29623f Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 15 Sep 2013 18:57:11 -0400 Subject: [PATCH] Modified js registration position. --- framework/yii/web/YiiAsset.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/yii/web/YiiAsset.php b/framework/yii/web/YiiAsset.php index 3c843a1..7d82027 100644 --- a/framework/yii/web/YiiAsset.php +++ b/framework/yii/web/YiiAsset.php @@ -8,6 +8,7 @@ namespace yii\web; use Yii; +use yii\base\View; /** * @author Qiang Xue @@ -29,12 +30,12 @@ class YiiAsset extends AssetBundle public function registerAssets($view) { parent::registerAssets($view); - $js[] = "yii.version = '" . Yii::getVersion() . "';"; + $js[] = "yii.version='" . Yii::getVersion() . "';"; $request = Yii::$app->getRequest(); if ($request instanceof Request && $request->enableCsrfValidation) { - $js[] = "yii.csrfVar = '{$request->csrfVar}';"; - $js[] = "yii.csrfToken = '{$request->csrfToken}';"; + $js[] = "yii.csrfVar='{$request->csrfVar}';"; + $js[] = "yii.csrfToken='{$request->csrfToken}';"; } - $view->registerJs(implode("\n", $js)); + $view->registerJs(implode("\n", $js), View::POS_END); } }