I am using yii2 advance template for project and trying to implement theme for backend.
To do that i have created a themes folder under backend folder as given below
app
- backend
-- themes
--- adminlte
---- js
---- css
---- layouts
----- main.php
---- views
- frontend
To get the theme url, i am using Yii::getAlias('@backend/themes/adminlte/js/abc.js')
and give me full path, /var/www/...
. But it gives me 404, page not found error even though file is present there.
Please someone help me about file path. It will work fine if i will get path like //themes/adminlte/js/abc.js
.
Code of config/main.php
'view' => [
'theme' => [
'basePath' => '@backend/themes/adminlte',
'baseUrl' => '@backend/themes/adminlte',
'pathMap' => [
'@backend/views' => '@backend/themes/adminlte',
],
],
],
Code of theme file(main.php)
<?php $themesPath = Yii::getAlias('@backend/themes/adminlte');
<link rel="stylesheet" href="<?php echo $this->theme->baseUrl; ?>
/bootstrap/css/bootstrap.min.css">
'view' => [ 'theme' => [ 'basePath' => '@backend/themes/adminlte', 'baseUrl' => '@backend/themes/adminlte', 'pathMap' => [ '@backend/views' => '@backend/themes/adminlte', ], ], ],
Code of theme file(main.php)theme->baseUrl; ?>/bootstrap/css/bootstrap.min.css">
– Alankar Oct 01 '15 at 16:36