Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 1... Zeile 1...
1
Config Files {#config.files}
1
# Config Files
2
============
-
 
Zeile 3... Zeile 2...
3
 
2
 
4
Config files are handy for designers to manage global template variables
3
Config files are handy for designers to manage global template variables
5
from one file. One example is template colors. Normally if you wanted to
4
from one file. One example is template colors. Normally if you wanted to
6
change the color scheme of an application, you would have to go through
5
change the color scheme of an application, you would have to go through
7
each and every template file and change the colors. With a config file,
6
each and every template file and change the colors. With a config file,
8
the colors can be kept in one place, and only one file needs to be
7
the colors can be kept in one place, and only one file needs to be
Zeile 9... Zeile 8...
9
updated.
8
updated.
10
 
9
 
11
 
10
```ini
12
    # global variables
11
# global variables
13
    pageTitle = "Main Menu"
12
pageTitle = "Main Menu"
14
    bodyBgColor = #000000
13
bodyBgColor = #000000
15
    tableBgColor = #000000
14
tableBgColor = #000000
16
    rowBgColor = #00ff00
15
rowBgColor = #00ff00
17
 
16
 
18
    [Customer]
17
[Customer]
19
    pageTitle = "Customer Info"
18
pageTitle = "Customer Info"
20
 
19
 
21
    [Login]
20
[Login]
22
    pageTitle = "Login"
21
pageTitle = "Login"
23
    focus = "username"
22
focus = "username"
24
    Intro = """This is a value that spans more
23
Intro = """This is a value that spans more
25
               than one line. you must enclose
24
           than one line. you must enclose
26
               it in triple quotes."""
25
           it in triple quotes."""
27
 
26
 
28
    # hidden section
27
# hidden section
29
    [.Database]
28
[.Database]
30
    host=my.example.com
29
host=my.example.com
31
    db=ADDRESSBOOK
30
db=ADDRESSBOOK
32
    user=php-user
31
user=php-user
Zeile 33... Zeile 32...
33
    pass=foobar
32
pass=foobar
34
 
33
```
35
      
34
      
36
 
35
 
37
Values of [config file variables](./language-variables/language-config-variables.md) can be in
36
Values of [config file variables](./language-variables/language-config-variables.md) can be in
38
quotes, but not necessary. You can use either single or double quotes.
-
 
39
If you have a value that spans more than one line, enclose the entire
37
quotes, but not necessary. You can use either single or double quotes.
Zeile 40... Zeile 38...
40
value with triple quotes (\"\"\"). You can put comments into config
38
If you have a value that spans more than one line, enclose the entire
41
files by any syntax that is not a valid config file syntax. We recommend
39
value with triple quotes \("""\). You can put comments into config
42
using a `
40
files by any syntax that is not a valid config file syntax. We recommend
43
  #` (hash) at the beginning of the line.
41
using a `#` (hash) at the beginning of the line.
Zeile 52... Zeile 50...
52
variable is used. If you name two variables the same within a section,
50
variable is used. If you name two variables the same within a section,
53
the last one will be used unless
51
the last one will be used unless
54
[`$config_overwrite`](../programmers/api-variables/variable-config-overwrite.md) is disabled.
52
[`$config_overwrite`](../programmers/api-variables/variable-config-overwrite.md) is disabled.
Zeile 55... Zeile 53...
55
 
53
 
56
Config files are loaded into templates with the built-in template
-
 
57
function [`
54
Config files are loaded into templates with the built-in template
58
  {config_load}`](./language-builtin-functions/language-function-config-load.md) or the API
55
function [`{config_load}`](./language-builtin-functions/language-function-config-load.md) or the API
Zeile 59... Zeile 56...
59
[`configLoad()`](../programmers/api-functions/api-config-load.md) function.
56
[`configLoad()`](../programmers/api-functions/api-config-load.md) function.
60
 
57
 
61
You can hide variables or entire sections by prepending the variable
58
You can hide variables or entire sections by prepending the variable