I’ve got my css and js files in web/css web/js folders respectively. I want to include them using AppAsset.php, which goes something like this:
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
// "css/bootstrap.min.css",
"css/font-awesome.min.css",
"css/prettyPhoto.css",
"css/price-range.css",
"css/animate.css",
"css/main.css",
"css/responsive.css"
];
public $js = [
// "js/jquery.js",
// "js/bootstrap.min.js",
"js/jquery.scrollUp.min.js",
"js/price-range.js",
"js/jquery.prettyPhoto.js",
"js/main.js"
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
and in my layouts/main.php I register it like this:
<?php
/* @var $this \yii\web\View */
/* @var $content string */
use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
My styles doesn’t appear. Can you point out my error?