\Yii::$app->assetManager->basePath = '/admin-assets';
<?php
namespace app\modules\admin;
use Yii;
use yii\base\BootstrapInterface;
use yii\base\InvalidConfigException;
use yii\web\Application;
/**
* admin module definition class
*/
class Module extends \yii\base\Module implements BootstrapInterface
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'app\modules\admin\controllers';
/**
* @inheritdoc
*/
public function init()
{
parent::init();
}
public function bootstrap($app)
{
if ($app instanceof Application) {
$app->getAssetManager()->baseUrl = '@web/assets-admin';
$app->getAssetManager()->basePath = $_SERVER['DOCUMENT_ROOT'] . '/web/assets-admin';
}
}
}