Changeset 4935
- Timestamp:
- 08/30/07 10:25:26 (3 years ago)
- Files:
-
- doc/trunk/book/06-Inside-the-Controller-Layer.txt (modified) (5 diffs)
- doc/trunk/book/18-Performance.txt (modified) (2 diffs)
- doc/trunk/book/19-Mastering-Symfony-s-Configuration-Files.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/trunk/book/06-Inside-the-Controller-Layer.txt
r4908 r4935 576 576 577 577 [php] 578 $this-> setFlash('attrib', $value);578 $this->getUser()->setFlash('notice', $value); 579 579 580 580 The template will be rendered and delivered to the user, who will then make a new request to another action. In this second action, just get the value of the flash attribute like this: 581 581 582 582 [php] 583 $value = $this->get Flash('attrib');584 585 Then forget about it. After delivering this second page, the ` attrib` flash attribute will be flushed. And even if you don't require it during this second action, the flash will disappear from the session anyway.586 587 If you need to access a flash attribute from a template, use the `$sf_ flash` object:588 589 [php] 590 <?php if ($sf_ flash->has('attrib')): ?>591 <?php echo $sf_ flash->get('attrib') ?>583 $value = $this->getUser()->getFlash('notice'); 584 585 Then forget about it. After delivering this second page, the `notice` flash attribute will be flushed. And even if you don't require it during this second action, the flash will disappear from the session anyway. 586 587 If you need to access a flash attribute from a template, use the `$sf_user` object: 588 589 [php] 590 <?php if ($sf_user->hasFlash('notice')): ?> 591 <?php echo $sf_user->getFlash('notice') ?> 592 592 <?php endif; ?> 593 593 … … 595 595 596 596 [php] 597 <?php echo $sf_ flash->get('attrib') ?>597 <?php echo $sf_user->getFlash('notice') ?> 598 598 599 599 Flash attributes are a clean way of passing information to the very next request. … … 890 890 cache: ~ 891 891 common: ~ 892 flash: ~893 892 execution: ~ 894 893 … … 916 915 917 916 >**TIP** 918 >The `enabled: off` parameter works well to disable your own filters, but you can deactivate the default filters via the `settings.yml` file, by modifying the values of the `web_debug`, `use_security`, `cache`, and `use_flash` settings. This is because each of the default filters has a `condition` parameter that tests the value of these settings.917 >The `enabled: off` parameter works well to disable your own filters, but you can deactivate the default filters via the `settings.yml` file, by modifying the values of the `web_debug`, `use_security`, and `cache` settings. This is because each of the default filters has a `condition` parameter that tests the value of these settings. 919 918 920 919 **New in development version** … … 989 988 cache: ~ 990 989 common: ~ 991 flash: ~992 990 execution: ~ 993 991 doc/trunk/book/18-Performance.txt
r4667 r4935 553 553 escaping_strategy: off # Output escaping feature 554 554 555 As for the security and the flash attributefeatures (see Chapter 6), you can deactivate them in the `filters.yml` file, as shown in Listing 18-21.555 As for the security features (see Chapter 6), you can deactivate them in the `filters.yml` file, as shown in Listing 18-21. 556 556 557 557 Listing 18-21 - Turning Features Off, in `myapp/config/filters.yml` … … 566 566 cache: ~ 567 567 common: ~ 568 flash:569 enabled: off570 571 568 execution: ~ 572 569 doc/trunk/book/19-Mastering-Symfony-s-Configuration-Files.txt
r4639 r4935 56 56 `use_database` | Enables the database manager. Set it to `off` if you don't use a database. | `on` 57 57 `use_security` | Enables security features (secure actions and credentials; see Chapter 6). The default security filter (`sfBasicSecurityFilter`) is enabled only if it is `on`. | `on` 58 `use_flash` | Enables the flash parameter feature (see Chapter 6). Set it to `off` if you never use the `set _flash()` method in your actions. The flash filter (`sfFlashFilter`) is enabled only if it is on. | `on`58 `use_flash` | Enables the flash parameter feature (see Chapter 6). Set it to `off` if you never use the `setFlash()` method of sfUser. | `on` 59 59 `i18n` | Enables interface translation (see Chapter 13). Set it to `on` for multilingual applications. | `off` 60 60 `logging_enabled` | Enables logging of symfony events. Set it to off when you want to ignore the logging.yml settings and turn symfony logging off completely. | `on`

