我想使用AppAsset.php使用位于web / css和web / js的样式。这是我的layout / main.php顶部的代码段:
<?php
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
这是我的AppAsset.php:
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',
];
}
您能指出我的错误吗?