Asset feature refactoring (WIP)

This commit is contained in:
Qiang Xue 2013-07-15 22:49:22 -04:00
parent 45731b4eb8
commit b6232130c1
5 changed files with 30 additions and 23 deletions

View File

@ -1 +0,0 @@
*

29
config/AppAsset.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\config;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class AppAsset extends AssetBundle
{
public $basePath = '@wwwroot';
public $baseUrl = '@www';
public $css = array(
'css/site.css',
);
public $js = array(
);
public $depends = array(
'yii\web\YiiAsset',
'yii\bootstrap\ResponsiveAsset',
);
}

View File

@ -1,18 +0,0 @@
<?php
return array(
'app' => array(
'basePath' => '@wwwroot',
'baseUrl' => '@www',
'css' => array(
'css/site.css',
),
'js' => array(
),
'depends' => array(
'yii',
'yii/bootstrap/responsive',
),
),
);

View File

@ -18,9 +18,6 @@ return array(
'class' => 'yii\web\User',
'identityClass' => 'app\models\User',
),
'assetManager' => array(
'bundles' => require(__DIR__ . '/assets.php'),
),
'log' => array(
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => array(

View File

@ -7,7 +7,7 @@ use yii\widgets\Breadcrumbs;
* @var $this \yii\base\View
* @var $content string
*/
$this->registerAssetBundle('app');
app\config\AppAsset::register($this);
?>
<?php $this->beginPage(); ?>
<!DOCTYPE html>