From 4c4f7bd70869b39ae57118d5ffb798c4472715f1 Mon Sep 17 00:00:00 2001 From: slavcodev Date: Wed, 13 Nov 2013 18:17:05 +0200 Subject: [PATCH] Move AppAsset from config to assets directory --- apps/advanced/backend/assets/.gitkeep | 1 - apps/advanced/backend/assets/AppAsset.php | 26 ++++++++++++++++++++++++ apps/advanced/backend/config/AppAsset.php | 26 ------------------------ apps/advanced/backend/views/layouts/main.php | 2 +- apps/advanced/frontend/assets/.gitkeep | 2 -- apps/advanced/frontend/assets/AppAsset.php | 29 +++++++++++++++++++++++++++ apps/advanced/frontend/config/AppAsset.php | 29 --------------------------- apps/advanced/frontend/views/layouts/main.php | 2 +- apps/basic/assets/AppAsset.php | 29 +++++++++++++++++++++++++++ apps/basic/config/AppAsset.php | 29 --------------------------- apps/basic/views/layouts/main.php | 2 +- docs/guide/view.md | 2 +- 12 files changed, 88 insertions(+), 91 deletions(-) delete mode 100644 apps/advanced/backend/assets/.gitkeep create mode 100644 apps/advanced/backend/assets/AppAsset.php delete mode 100644 apps/advanced/backend/config/AppAsset.php delete mode 100644 apps/advanced/frontend/assets/.gitkeep create mode 100644 apps/advanced/frontend/assets/AppAsset.php delete mode 100644 apps/advanced/frontend/config/AppAsset.php create mode 100644 apps/basic/assets/AppAsset.php delete mode 100644 apps/basic/config/AppAsset.php diff --git a/apps/advanced/backend/assets/.gitkeep b/apps/advanced/backend/assets/.gitkeep deleted file mode 100644 index 72e8ffc..0000000 --- a/apps/advanced/backend/assets/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/apps/advanced/backend/assets/AppAsset.php b/apps/advanced/backend/assets/AppAsset.php new file mode 100644 index 0000000..bd5c3a0 --- /dev/null +++ b/apps/advanced/backend/assets/AppAsset.php @@ -0,0 +1,26 @@ + + * @since 2.0 + */ +class AppAsset extends AssetBundle +{ + public $basePath = '@webroot'; + public $baseUrl = '@web'; + public $css = ['css/site.css']; + public $js = []; + public $depends = [ + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', + ]; +} diff --git a/apps/advanced/backend/config/AppAsset.php b/apps/advanced/backend/config/AppAsset.php deleted file mode 100644 index 2fd15ca..0000000 --- a/apps/advanced/backend/config/AppAsset.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @since 2.0 - */ -class AppAsset extends AssetBundle -{ - public $basePath = '@webroot'; - public $baseUrl = '@web'; - public $css = ['css/site.css']; - public $js = []; - public $depends = [ - 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', - ]; -} diff --git a/apps/advanced/backend/views/layouts/main.php b/apps/advanced/backend/views/layouts/main.php index 0093326..9f0280d 100644 --- a/apps/advanced/backend/views/layouts/main.php +++ b/apps/advanced/backend/views/layouts/main.php @@ -1,5 +1,5 @@ + * @since 2.0 + */ +class AppAsset extends AssetBundle +{ + public $basePath = '@webroot'; + public $baseUrl = '@web'; + public $css = [ + 'css/site.css', + ]; + public $js = [ + ]; + public $depends = [ + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', + ]; +} diff --git a/apps/advanced/frontend/config/AppAsset.php b/apps/advanced/frontend/config/AppAsset.php deleted file mode 100644 index 98306e3..0000000 --- a/apps/advanced/frontend/config/AppAsset.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @since 2.0 - */ -class AppAsset extends AssetBundle -{ - public $basePath = '@webroot'; - public $baseUrl = '@web'; - public $css = [ - 'css/site.css', - ]; - public $js = [ - ]; - public $depends = [ - 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', - ]; -} diff --git a/apps/advanced/frontend/views/layouts/main.php b/apps/advanced/frontend/views/layouts/main.php index ec78ac0..7b2ce6f 100644 --- a/apps/advanced/frontend/views/layouts/main.php +++ b/apps/advanced/frontend/views/layouts/main.php @@ -3,7 +3,7 @@ use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; -use frontend\config\AppAsset; +use frontend\assets\AppAsset; use frontend\widgets\Alert; /** diff --git a/apps/basic/assets/AppAsset.php b/apps/basic/assets/AppAsset.php new file mode 100644 index 0000000..c964d36 --- /dev/null +++ b/apps/basic/assets/AppAsset.php @@ -0,0 +1,29 @@ + + * @since 2.0 + */ +class AppAsset extends AssetBundle +{ + public $basePath = '@webroot'; + public $baseUrl = '@web'; + public $css = [ + 'css/site.css', + ]; + public $js = [ + ]; + public $depends = [ + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', + ]; +} diff --git a/apps/basic/config/AppAsset.php b/apps/basic/config/AppAsset.php deleted file mode 100644 index 87f6f8b..0000000 --- a/apps/basic/config/AppAsset.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @since 2.0 - */ -class AppAsset extends AssetBundle -{ - public $basePath = '@webroot'; - public $baseUrl = '@web'; - public $css = [ - 'css/site.css', - ]; - public $js = [ - ]; - public $depends = [ - 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', - ]; -} diff --git a/apps/basic/views/layouts/main.php b/apps/basic/views/layouts/main.php index 49b0f4c..8489e9c 100644 --- a/apps/basic/views/layouts/main.php +++ b/apps/basic/views/layouts/main.php @@ -3,7 +3,7 @@ use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; -use app\config\AppAsset; +use app\assets\AppAsset; /** * @var \yii\web\View $this diff --git a/docs/guide/view.md b/docs/guide/view.md index 1b366a6..5951a30 100644 --- a/docs/guide/view.md +++ b/docs/guide/view.md @@ -240,7 +240,7 @@ details on how to define asset bundles in [asset manager](assets.md) section of asset bundle, it's very straightforward: ```php -frontend\config\AppAsset::register($this); +frontend\assets\AppAsset::register($this); ``` ### Layout