Changeset 6613
- Timestamp:
- 12/20/07 15:39:34 (1 year ago)
- Files:
-
- doc/branches/1.1/book/06-Inside-the-Controller-Layer.txt (modified) (1 diff)
- doc/branches/1.1/book/07-Inside-the-View-Layer.txt (modified) (8 diffs)
- doc/branches/1.1/book/09-Links-and-the-Routing-System.txt (modified) (1 diff)
- doc/branches/1.1/book/11-Ajax-Integration.txt (modified) (1 diff)
- doc/branches/1.1/book/13-I18n-and-L10n.txt (modified) (1 diff)
- doc/branches/1.1/book/16-Application-Management-Tools.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.1/book/06-Inside-the-Controller-Layer.txt
r6611 r6613 927 927 >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. 928 928 929 **New in development version**929 **New in symfony 1.1** 930 930 931 931 >**SIDEBAR** doc/branches/1.1/book/07-Inside-the-View-Layer.txt
r6117 r6613 291 291 >All the helpers so far were called by `<?php echo functionName() ?>`. The partial helper, however, is simply called by `<?php include_partial() ?>`, without `echo`, to make it behave similar to the regular PHP `include()` statement. If you ever need a function that returns the content of a partial without actually displaying it, use `get_partial()` instead. All the `include_` helpers described in this chapter have a `get_` counterpart that can be called together with an `echo` statement. 292 292 293 >**New in development version**: Instead of resulting in a template, an action can return a partial. The `renderPartial()` method of the action class promotes reusability of code and takes advantage of the caching abilities of the partials (see Chapter 12). The variables defined in the action will be passed to the partial automatically. 293 >**TIP** 294 >**New in symfony 1.1**: Instead of resulting in a template, an action can return a partial. The `renderPartial()` method of the action class promotes reusability of code and takes advantage of the caching abilities of the partials (see Chapter 12). The variables defined in the action will be passed to the partial automatically. 294 295 > 295 296 > [php] … … 668 669 669 670 // In the Template 670 use_stylesheet('mystyle1');671 use_stylesheet('mystyle2');672 use_javascript('myscript');671 <?php use_stylesheet('mystyle1') ?> 672 <?php use_stylesheet('mystyle2') ?> 673 <?php use_javascript('myscript') ?> 673 674 674 675 In each case, the argument is a file name. If the file has a logical extension (`.css` for a style sheet and `.js` for a JavaScript file), you can omit it. If the file has a logical location (`/css/` for a style sheet and `/js/` for a JavaScript file), you can omit it as well. Symfony is smart enough to figure out the correct extension or location. … … 743 744 744 745 // In the template 745 use_stylesheet('special', 'first');746 747 **New in development version**: You can also decide to bypass the transformation of the asset file name, so that the resulting `<link>` or `<script>` tags refer to the exact location specified, as show in Listing 7-32.746 <?php use_stylesheet('special', 'first') ?> 747 748 **New in symfony 1.1**: You can also decide to bypass the transformation of the asset file name, so that the resulting `<link>` or `<script>` tags refer to the exact location specified, as show in Listing 7-32. 748 749 749 750 Listing 7-32 - Style Sheet Inclusion with Raw Name … … 758 759 759 760 // In the template 760 use_stylesheet('paper', '', array('raw_name' => true));761 <?php use_stylesheet('paper', '', array('raw_name' => true)) ?> 761 762 762 763 // Resulting View … … 776 777 777 778 // In the template 778 use_stylesheet('paper', '', array('media' => 'print'));779 <?php use_stylesheet('paper', '', array('media' => 'print')) ?> 779 780 780 781 // Resulting View … … 798 799 799 800 // In the template 800 decorate_with('my_layout');801 <?php decorate_with('my_layout') ?> 801 802 802 803 Some views don't need any layout at all (for instance, plain text pages or RSS feeds). In that case, set `has_layout` to `false`, as shown in Listing 7-35. … … 813 814 814 815 // In the template 815 decorate_with(false);816 <?php decorate_with(false) ?> 816 817 817 818 >**NOTE** … … 1030 1031 >The usual symfony variables are also escaped when you turn on output escaping. So be aware that `$sf_user`, `$sf_request`, `$sf_param`, and `$sf_context` still work, but their methods return escaped data, unless you add `ESC_RAW` as a final argument to their method calls. 1031 1032 1032 **New in development version** 1033 1034 >**TIP** 1035 >Even if XSS is one of the most common exploit of websites, this is not the only one. CSRF is also very popular and symfony provides a simple way to protect your applications. Read the sidebar named "The CSRF Filter" in Chapter 6 for more information. 1033 >**TIP** 1034 >**New in symfony 1.1**: Even if XSS is one of the most common exploit of websites, this is not the only one. CSRF is also very popular and symfony provides a simple way to protect your applications. Read the sidebar named "The CSRF Filter" in Chapter 6 for more information. 1036 1035 1037 1036 Summary doc/branches/1.1/book/09-Links-and-the-Routing-System.txt
r6117 r6613 611 611 The object that handles the routing rules is the `sfRouting` factory. It is available from every part of the code by requiring `sfContext::getInstance()->getRouting()`. Its `prependRoute()` method adds a new rule on top of the existing ones defined in `routing.yml`. It expects four parameters, which are the same as the parameters needed to define a rule: a route label, a pattern, an associative array of default values, and another associative array for requirements. For instance, the routing.yml rule definition shown in Listing 9-18 is equivalent to the PHP code shown in Listing 9-24. 612 612 613 ** New in development version **614 615 613 >**NOTE** 616 > The routing class is configurable in the `factories.yml` configuration file (to change the default routing class, see chapter 17). This chapter talks about the `sfPatternRouting` class, which is the routing class configured by default.614 >**New in symfony 1.1**: The routing class is configurable in the `factories.yml` configuration file (to change the default routing class, see chapter 17). This chapter talks about the `sfPatternRouting` class, which is the routing class configured by default. 617 615 618 616 Listing 9-24 - Defining a Rule in PHP doc/branches/1.1/book/11-Ajax-Integration.txt
r6400 r6613 231 231 >Because responsiveness is crucial in Ajax interactions, if the response is not too complex, it might be a good idea to avoid creating a view and instead return the response directly from the action. So you can use the `renderText()` method in the action to skip the template and boost Ajax requests. 232 232 > 233 >**New in development version**: Most Ajax actions result in a template that simply includes a partial, because the code of the Ajax response is already used to display the initial page. To avoid creating a template for just one line of code, the action can use the `renderPartial()` method. This method takes advantage of both the reusability of partials, their caching abilities, and the speed of the `renderText()` method.233 >**New in symfony 1.1**: Most Ajax actions result in a template that simply includes a partial, because the code of the Ajax response is already used to display the initial page. To avoid creating a template for just one line of code, the action can use the `renderPartial()` method. This method takes advantage of both the reusability of partials, their caching abilities, and the speed of the `renderText()` method. 234 234 > 235 235 > [php] doc/branches/1.1/book/13-I18n-and-L10n.txt
r4360 r6613 358 358 Another way to organize translation dictionaries is to split them by module. Instead of writing a single `messages.XX.xml` file for the whole application, you can write one in each `modules/[module_name]/i18n/` directory. It makes modules more independent from the application, which is necessary if you want to reuse them, such as in plug-ins (see Chapter 17). 359 359 360 **New in development version**360 **New in symfony 1.1** 361 361 362 362 As updating the i18n dictionaries by hand is quite error prone, symfony provides a task to automate the process. The `i18n-extract` task parses a symfony application to extract all the strings that need to be translated. It takes an application and a culture as its arguments: doc/branches/1.1/book/16-Application-Management-Tools.txt
r4848 r6613 95 95 96 96 >**SIDEBAR** 97 >Customizing the logging 98 > 99 >**New in development version** 97 >**New in symfony 1.1**: Customizing the logging 100 98 > 101 99 >Symfony's logging system is very simple, yet it is also easy to customize.