radoo
(Radu)
December 23, 2014, 1:41pm
1
After setting up the advanced template and configuring the frontend to use a theme (nothing fancy, just a copy of the views folder from the app) I get an error.
Here’s what I did:
installed advanced template and done init and configuration, so everyting works well when accesing http://localhost/yii...d/web/index.php
created folders /themes/test/ in frontend/web/ directory
copied the folder /frontend/views to /frontend/web/themes/test/
created the following config in frontend/config/main-local.php
$config = [
'components' => [
'view' => array(
'class' => 'yii\base\View',
'theme' => array(
//'class' => 'yii\base\Theme',
'pathMap' => array('@frontend/views' => '@frontend/web/themes/test/views'),
//'baseUrl' => '@frontend/web/themes/test',
)
)
],
];
refreshed frontend index
i get:
Setting unknown property: yii\base\View::title
[color="#505050 "][font=“Arial, sans-serif”] [/font][/color][color="#505050 "][font=“Arial, sans-serif”][size=“2”]in [/size][/font][/color][color=#505050][font=Arial, sans-serif][size=2]D:\wamp24\www\yii2adv\frontend\web\themes\test\views\site\index.php[/size][/font][/color][color="#505050 "][font=“Arial, sans-serif”] [/font][/color][color="#505050 "][font=“Arial, sans-serif”][size=“2”]– yii\base\Component::__set([color="#00AA00 "][font=“inherit”][size=“2”]‘title’[/size][/font][/color], [color="#00AA00 "][font=“inherit”][size=“2”]‘My Yii Application’[/size][/font][/color])[/size][/font][/color]
[font="Arial, sans-serif"] [/font][color="#505050 "][font="Arial, sans-serif"] [/font][/color][color="#505050 "][font="Arial, sans-serif"][size="2"]at line [/size][/font][/color][color="#505050 "][font="Arial, sans-serif"][size="2"]5[/size][/font][/color]
[font=“Consolas,”] $this[/font][color="#505050 "][font=“Consolas,”]->title = [/font][/color][font=“Consolas,”]‘My Yii Application’[/font][color="#505050 "][font=“Consolas,”];[/font][/color]
If I comment out that line it stops at a further instruction with "Calling unknown method: yii\base\View::registerAssetBundle() ", when trying to do the default "[color="#505050 "][font="Consolas,"][size="2"]AppAsset::register([/size][/font][/color][font="Consolas,"][size="2"]$this[/size][/font][color="#505050 "][font="Consolas,"][size="2"]);" in frontend/views/layouts/main.php[/size][/font][/color]
Am I doing something wrong here?
This seems like the most safe and basic setup that one can perform for a theme on the advanced template and it fails…
radoo
(Radu)
December 23, 2014, 2:33pm
2
Problem solved:
delete the [size=2] ‘class’ => ‘yii\base\View’, from the view configuration below[/size]
[size=2]- or replace it with ‘yii\web\View’[/size]
radoo:
After setting up the advanced template and configuring the frontend to use a theme (nothing fancy, just a copy of the views folder from the app) I get an error.
Here’s what I did:
installed advanced template and done init and configuration, so everyting works well when accesing http://localhost/yii...d/web/index.php
created folders /themes/test/ in frontend/web/ directory
copied the folder /frontend/views to /frontend/web/themes/test/
created the following config in frontend/config/main-local.php
$config = [
'components' => [
'view' => array(
'class' => 'yii\base\View',
'theme' => array(
//'class' => 'yii\base\Theme',
'pathMap' => array('@frontend/views' => '@frontend/web/themes/test/views'),
//'baseUrl' => '@frontend/web/themes/test',
)
)
],
];
refreshed frontend index
i get:
If I comment out that line it stops at a further instruction with "Calling unknown method: yii\base\View::registerAssetBundle() ", when trying to do the default "[color="#505050 "][font="Consolas,"][size="2"]AppAsset::register([/size][/font][/color][font="Consolas,"][size="2"]$this[/size][/font][color="#505050 "][font="Consolas,"][size="2"]);" in frontend/views/layouts/main.php[/size][/font][/color]
Am I doing something wrong here?
This seems like the most safe and basic setup that one can perform for a theme on the advanced template and it fails…