Yii2 未加载Yi2登录资产CSS

Yii2 未加载Yi2登录资产CSS,yii2,assets,Yii2,Assets,我创建了登录资产和登录布局。为什么登录页面不加载css文件 class LoginAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'gent/css/bootstrap.min.css', 'gent/css/font-awesome.min.css', 'gent/css/nprogress.css', 'g

我创建了登录资产和登录布局。为什么登录页面不加载css文件

class LoginAsset extends AssetBundle {

public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
    'gent/css/bootstrap.min.css',
    'gent/css/font-awesome.min.css',
    'gent/css/nprogress.css',
    'gent/css/animate.min.css',
    'gent/css/custom.min.css"',
];
public $js = [
];
public $depends = [
    'yii\web\YiiAsset',
    'yii\bootstrap\BootstrapAsset',
];

}




编辑以下部分:(添加beginBody)


#代码。。。
我没有在你的代码中看到
public function actionLogin() {
    $this->layout = 'login';
    return $this->render('login', [
                'model' => $model,
    ]);
}
<?php

/**
 * @var string $content
 * @var \yii\web\View $this
 */
use app\assets\LoginAsset;
use yii\helpers\Html;

LoginAsset::register($this);
?>
<?php $this->beginPage(); ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta charset="<?= Yii::$app->charset ?>" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <?= Html::csrfMetaTags() ?>
        <title>QAMETWIS</title>
        <?php $this->head() ?>

    </head>
    <body class="login">
        <?php echo $content ?>
    </body>


</html>
<?php $this->endPage(); ?>
<body>
<?php $this->beginBody() ?>

  # Code ...

<?php $this->endBody() ?>
</body>