Yii2 - 模板主题问题

时间:2016-01-19 04:35:55

标签: html css themes yii2 yii2-advanced-app

我正在使用yii2-advanced app。我最近在我的应用中应用了一个模板。但是现在(在应用模板/主题之后),我的'combineiolist'无效。

这是我的'index.php代码,我想使用combineiolist:

<div class="main_bg">
<div class="wrap">
    <div class="main">
        <!-- start gallery  -->
            <div class="container">
                <div id="portfoliolist">
                    <?php
                    $m = $dataProvider;
                    foreach ($m as $dp) {
                        echo '<a id ="img_id" class="" href="http://localhost/efa-webv1/frontend/web/index.php?r=site/subcat&img_id='.$dp['bmc_id'].'" method="get">';                        // echo '<a onclick="alert('.$dp['bmc_id'].')"';
                        echo '<div class="portfolio logo1" data-cat="logo">';
                        echo '<div class="portfolio-wrapper">';
                        echo "<img src = '"."http://www.abcd.com/web/".$dp['bmc_image']."' />";
                        echo '<center><font color = "white">'.$dp['bmc_name'].'<font/></center>';
                        echo '</div>';
                        echo '</div>';
                        echo '</a>';
                    } ?>
                </div>
            </div><!-- end container -->
    </div>
</div>
</div>

而且,我的'AppAsset.php'是(如果需要):

<?php
namespace frontend\assets;

use yii\web\AssetBundle;

class AppAsset extends AssetBundle
{
    // public $basePath = '@webroot';
    // public $baseUrl = '@web';
    public $sourcePath='@bower/efatheme/';
    public $css = [
        'css/magnific-popup.css',
        'css/style.css',
        'css/magnific-popup.css',
        'http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css'
    ];
    public $js = [
        'js/jquery.min.js',
        'js/jquery.easing.min.js',
        'js/jquery.mixitup.min.js',
        'js/jquery.magnific-popup.js',
        'js/classie.js',
        'js/uisearch.js',
        'js/responsive.menu.js',
        'js/jquery.contentcarousel.js',
        'js/jquery.mousewheel.js',
        'js/jquery-1.11.0.min.js',
        'js/jquery.leanModal.min.js',
        'https://apis.google.com/js/client.js?onload=init',
        'https://apis.google.com/js/client.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
    ];
}

那么,我该怎么办才能让它发挥作用?或者是否有任何替代投资组合,以便我的内容显示如下 -

please look at this snap

1 个答案:

答案 0 :(得分:0)

我找到了答案。问题出在AppAsset.php中。我刚刚用我之前的那个替换它 -

<?php

namespace frontend\assets;

use yii\web\AssetBundle;

class AppAsset extends AssetBundle
{
    //public $basePath = '@webroot';
    //public $baseUrl = '@web';
    public $sourcePath='@bower/efatheme/';
    public $css = [
        'css/magnific-popup.css',
        'css/style.css'
    ];
    public $js = [
        'js/jquery.min.js',
        'js/jquery.easing.min.js',
        'js/jquery.mixitup.min.js',
        'js/jquery.magnific-popup.js',
        'js/classie.js',
        'js/uisearch.js',
        'js/responsive.menu.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
    ];
}

现在工作正常!!!