Changeset 9917
- Timestamp:
- 06/27/08 11:28:06 (4 months ago)
- Files:
-
- doc/branches/1.0/book/05-Configuring-Symfony.txt (modified) (4 diffs)
- doc/branches/1.1/book/05-Configuring-Symfony.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.0/book/05-Configuring-Symfony.txt
r4907 r9917 142 142 webmaster: webmaster@example.com 143 143 144 In this example, `mail` is a key and `general` is only a category header. Everything works as if the category header didn't exist, as shown in Listing 5-10. The `tax` parameter is actually a direct child of the `all` key. 144 In this example, `mail` is a key and `general` is only a category header. Everything works as if the category header didn't exist, as shown in Listing 5-10. The `tax` parameter is actually a direct child of the `all` key. However using categories helps symfony dealing with arrays that are beneath the `all` key. 145 145 146 146 Listing 5-10 - Category Headers Are Only There for Readability and Are Actually Ignored … … 497 497 498 498 all: 499 version: 1.5500 499 .general: 501 500 tax: 19.6 … … 513 512 514 513 [php] 515 echo sfConfig::get('app_version');516 => '1.5'517 514 echo sfConfig::get('app_tax'); // Remember that category headers are ignored 518 515 => '19.6' … … 569 566 [php] 570 567 sfConfig::get('app_creditcards_fake'); 568 569 >**NOTE** 570 >When you should require an PHP array directly beneath the `all` key you need to use a category header, otherwise symfony will make the values separately available as shown above. 571 > 572 > all: 573 > .array: 574 > creditcards: 575 > fake: off 576 > visa: on 577 > americanexpress: on 578 > 579 > [php] 580 > print_r(sfConfig::get('app_creditcards')); 581 > 582 > Array( 583 > [fake] => false 584 > [visa] => true 585 > [americanexpress] => true 586 > ) 571 587 572 588 >**TIP** doc/branches/1.1/book/05-Configuring-Symfony.txt
r9782 r9917 142 142 webmaster: webmaster@example.com 143 143 144 In this example, `mail` is a key and `general` is only a category header. Everything works as if the category header didn't exist, as shown in Listing 5-10. The `tax` parameter is actually a direct child of the `all` key. 144 In this example, `mail` is a key and `general` is only a category header. Everything works as if the category header didn't exist, as shown in Listing 5-10. The `tax` parameter is actually a direct child of the `all` key. However using categories helps symfony dealing with arrays that are beneath the `all` key. 145 145 146 146 Listing 5-10 - Category Headers Are Only There for Readability and Are Actually Ignored … … 461 461 462 462 all: 463 version: 1.5464 463 .general: 465 464 tax: 19.6 … … 477 476 478 477 [php] 479 echo sfConfig::get('app_version');480 => '1.5'481 478 echo sfConfig::get('app_tax'); // Remember that category headers are ignored 482 479 => '19.6' … … 533 530 [php] 534 531 sfConfig::get('app_creditcards_fake'); 532 533 >**NOTE** 534 >When you should require an PHP array directly beneath the `all` key you need to use a category header, otherwise symfony will make the values separately available as shown above. 535 > 536 > all: 537 > .array: 538 > creditcards: 539 > fake: off 540 > visa: on 541 > americanexpress: on 542 > 543 > [php] 544 > print_r(sfConfig::get('app_creditcards')); 545 > 546 > Array( 547 > [fake] => false 548 > [visa] => true 549 > [americanexpress] => true 550 > ) 535 551 536 552 >**TIP**