mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 14:28:27 +08:00
Corrected theming docs not to give an example of theme view files under webroot
This commit is contained in:
@ -18,7 +18,7 @@ be in your application config file:
|
||||
'components' => [
|
||||
'view' => [
|
||||
'theme' => [
|
||||
'pathMap' => ['@app/views' => '@webroot/themes/basic'],
|
||||
'pathMap' => ['@app/views' => '@app/themes/basic'],
|
||||
'baseUrl' => '@web/themes/basic',
|
||||
],
|
||||
],
|
||||
@ -26,8 +26,8 @@ be in your application config file:
|
||||
```
|
||||
|
||||
In the above `pathMap` defines where to look for view files while `baseUrl` defines base URL for resources referenced
|
||||
from these files. For example, if `pathMap` is `['/web/views' => '/web/themes/basic']`, then the themed version
|
||||
for a view file `/web/views/site/index.php` will be `/web/themes/basic/site/index.php`.
|
||||
from these files. In our case `pathMap` is `['@app/views' => '@app/themes/basic']` so the themed version
|
||||
for a view file `@app/views/site/index.php` will be `@app/themes/basic/site/index.php`.
|
||||
|
||||
Using multiple paths
|
||||
--------------------
|
||||
@ -36,14 +36,14 @@ It is possible to map a single path to multiple paths. For example,
|
||||
|
||||
```php
|
||||
'pathMap' => [
|
||||
'/web/views' => [
|
||||
'/web/themes/christmas',
|
||||
'/web/themes/basic',
|
||||
'@app/views' => [
|
||||
'@app/themes/christmas',
|
||||
'@app/themes/basic',
|
||||
],
|
||||
]
|
||||
```
|
||||
|
||||
In this case, the view will be searched in `/web/themes/christmas/site/index.php` then if it's not found it will check
|
||||
`/web/themes/basic/site/index.php`. If there's no view there as well application view will be used.
|
||||
In this case, the view will be searched in `@app/themes/christmas/site/index.php` then if it's not found it will check
|
||||
`@app/themes/basic/site/index.php`. If there's no view there as well application view will be used.
|
||||
|
||||
This ability is especially useful if you want to temporary or conditionally override some views.
|
||||
|
Reference in New Issue
Block a user