<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace app\assets;

use yii\web\AssetBundle;

/**
 * Main application asset bundle.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.min.css',
		'css/contents.min.css',
		'css/chart.min.css'
    ];
    public $js = [
		'js/chart.min.js',
		'js/widget2chart.js',
		'js/js.js',
    ];
    public $depends = [
        'yii\bootstrap4\BootstrapAsset',
        'yii\web\JqueryAsset',
	    'yii\web\YiiAsset'
    ];
	public $jsOptions = [
		'defer'=>true
	];
//	public $cssOptions = [
//		"rel"=>"preload",
//		"as"=>"style",
//		"onload"=>"this.rel='stylesheet'"
//	];
	public function init()
    {
        parent::init();
        \Yii::$app->assetManager->bundles['yii\\web\\JqueryAsset'] = [
			'jsOptions' => ['position' => \yii\web\View::POS_HEAD, 'defer' => true],
			'js' => ['jquery.min.js']
        ];
        \Yii::$app->assetManager->bundles['yii\\web\\YiiAsset'] = [
            'jsOptions' => ['position' => \yii\web\View::POS_HEAD, 'defer' => true]
        ];
    }
}
