Closed nsanden closed 9 years ago
Show the code of connection assets
Which code do you want? It could just be that i'm not setting up my configuration properly. (I'm very new to Yii2)
It's working now after changing:
'view' => [
'class' => '\rmrevin\yii\minify\View',
'base_path' => '@app/web', // path to web base,
'minify_path' => '@app/web/minify', // path to save minify result
],
to:
'view' => [
'class' => '\rmrevin\yii\minify\View',
'base_path' => $_SERVER['DOCUMENT_ROOT'], // path to web base,
'minify_path' => '@app/web/minify', // path to save minify result
],
Here's code I think you wanted:
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace frontend\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/custom.css',
];
public $js = [
'js/jquery.cookie.js',
'js/jquery.density.js',
'js/jquery.highlight.js',
'js/jquery.textarearesizer.compressed.js',
'js/garlic.js',
'js/custom.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
'yii\web\JqueryAsset',
];
}
Show your
echo Yii::getAlias('@app/web');
Here is the output: /home/wordcoun/public_html/new/advanced/frontend/web
My entry script is at /home/wordcoun/public_html/index.php
Obsolete
PHP Warning – yii\base\ErrorException
sha1_file(/home/wordcoun/public_html/new/advanced/frontend/web/new/advanced/frontend/web/assets/8604a1d6/css/bootstrap.css): failed to open stream: No such file or directory
It's duplicating the /new/advanced/frontend/web/ part of the path