Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
88343c1f
Commit
88343c1f
authored
Nov 28, 2014
by
Christopher Vrooman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update output-theming.md
Minor syntax changes.
parent
c6b0e24a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
output-theming.md
docs/guide/output-theming.md
+14
-14
No files found.
docs/guide/output-theming.md
View file @
88343c1f
...
...
@@ -4,17 +4,17 @@ Theming
> Note: This section is under development.
A theme is a directory of view and layout files. Each file of the theme overrides corresponding file of an application
when rendered. A single application may use multiple themes and each may provide totally different experience. At any
when rendered. A single application may use multiple themes and each may provide totally different experience
s
. At any
time only one theme can be active.
> Note: Themes
usually do
not meant to be redistributed since views are too application specific. If you want to
redistribute
customized look and feel consider CSS and JavaScript files in
form of
[
asset bundles
](
structure-assets.md
)
instead.
> Note: Themes
are usually
not meant to be redistributed since views are too application specific. If you want to
redistribute
a customized look and feel, consider CSS and JavaScript files in the
form of
[
asset bundles
](
structure-assets.md
)
instead.
Configuring a theme
-------------------
Theme configuration is specified via
`view`
component of the application. In order to set up a theme to work with basic
application views the following should be in your application config file:
Theme configuration is specified via
the
`view`
component of the application. In order to set up a theme to work with basic
application views
,
the following should be in your application config file:
```
php
'components'
=>
[
...
...
@@ -27,8 +27,8 @@ application views the following should be in your application config file:
],
```
In the above
`pathMap`
defines a map of original paths to themed paths while
`baseUrl`
defines
base URL for
resources referenced
from
theme files.
In the above
,
`pathMap`
defines a map of original paths to themed paths while
`baseUrl`
defines the
base URL for
resources referenced
by
theme files.
In our case
`pathMap`
is
`['@app/views' => '@app/themes/basic']`
. That means that every view in
`@app/views`
will be
first searched under
`@app/themes/basic`
and if a view exists in the theme directory it will be used instead of the
...
...
@@ -40,7 +40,7 @@ For example, with a configuration above a themed version of a view file `@app/vi
### Theming modules
In order to theme modules
`pathMap`
may look like the following:
In order to theme modules
,
`pathMap`
may look like the following:
```
php
'components'
=>
[
...
...
@@ -59,8 +59,8 @@ It will allow you to theme `@app/modules/blog/views/comment/index.php` with `@ap
### Theming widgets
In order to theme a widget view located at
`@app/widgets/currency/views/index.php`
you need the following config
for
view component theme:
In order to theme a widget view located at
`@app/widgets/currency/views/index.php`
, you need the following configuration
for
the
view component theme:
```
php
'components'
=>
[
...
...
@@ -72,7 +72,7 @@ view component theme:
],
```
With the config
above you can create themed version of
`@app/widgets/currency/index.php`
view in
With the config
uration above you can create a themed version of the
`@app/widgets/currency/index.php`
view in
`@app/themes/basic/widgets/currency/index.php`
.
Using multiple paths
...
...
@@ -89,7 +89,7 @@ It is possible to map a single path to multiple theme paths. For example,
]
```
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.
In this case,
first the view will be searched for
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
, then the
application view will be used.
This ability is especially useful if you want to temporary or conditionally override some views.
This ability is especially useful if you want to temporar
il
y or conditionally override some views.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment