FrameworkAsset为继承yii\web\AssetBundle的PHP类

文档问题 · lesvere · 于 6年前 发布 · 2022 次阅读

上图为FrameworkAsset内容

下图为layouts/main.php内容

出现的问题是:js文件注册进来了,但是css文件都没进来。下截图为chrome:view-source 其中的部分js为main中原生html代码所定义,但是定义在上图为FrameworkAsset内容中的js文件都没显示。

共收到 4 条回复 问题提问
lesvere#16年前 0 个赞

{

public $sourcePath = '@app/modules/static';
public $css = [
    'bower_components/bootstrap/dist/css/bootstrap.min.css',
    'bower_components/font-awesome/css/font-awesome.min.css',
    'bower_components/Ionicons/css/ionicons.min.css',
    'dist/css/AdminLTE.min.css',
    'dist/css/skins/_all-skins.min.css',
    'bower_components/morris.js/morris.css',
    'bower_components/jvectormap/jquery-jvectormap.css',
    'bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css',
    'bower_components/bootstrap-daterangepicker/daterangepicker.css',
    'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css',
];
public $js = [
    'bower_components/bootstrap/dist/js/bootstrap.min.js',
    'bower_components/raphael/raphael.min.js',
    'bower_components/morris.js/morris.min.js',
    'bower_components/jquery-sparkline/dist/jquery.sparkline.min.js',
    'plugins/jvectormap/jquery-jvectormap-1.2.2.min.js',
    'plugins/jvectormap/jquery-jvectormap-world-mill-en.js',
    'bower_components/jquery-knob/dist/jquery.knob.min.js',
    'bower_components/moment/min/moment.min.js',
    'bower_components/bootstrap-daterangepicker/daterangepicker.js',
    'bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js',
    'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js',
    'bower_components/jquery-slimscroll/jquery.slimscroll.min.js',
    'bower_components/fastclick/lib/fastclick.js',
    'dist/js/adminlte.min.js',
    'dist/js/pages/dashboard.js',
    'dist/js/demo.js',
];
public $depends = [
    'yii\web\YiiAsset',
    'yii\bootstrap\BootstrapAsset',
];
lesvere#26年前 0 个赞

<?php

/**

  • @var $this \yii\web\View
  • @var $content string */

use yii\helpers\Html; use backend\modules\shop\assets\FrameworkAsset;

FrameworkAsset::register($this); ?> <?php $this->beginPage() ?> <!DOCTYPE <?= Yii::$app->language?>>

3楼 已删除.
lesvere#46年前 0 个赞

sorry,问题解决了。$this->head()没加上

Fecmall#56年前 0 个赞

OK

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics