Development

Changeset 11077

You must first sign up to be able to contribute.

Changeset 11077

Show
Ignore:
Timestamp:
08/24/08 13:49:13 (3 months ago)
Author:
Javier.Eguiluz
Message:

[doc] [1.0] Fixed syntax issues

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.0/book/07-Inside-the-View-Layer.txt

    r9469 r11077  
    232232>Another code fragment type, called a component slot, is to be used when the nature of the fragment depends on the context (for instance, if the fragment needs to be different for the actions of a given module). Component slots are described later in this chapter. 
    233233 
    234 The inclusion of these fragments is achieved by helpers of the Partial group. These helpers are available from any symfony template, without initial declaration. 
     234The inclusion of these fragments is achieved by helpers of the `Partial` group. These helpers are available from any symfony template, without initial declaration. 
    235235 
    236236### Partials 
     
    550550In addition to the setter methods shown here, the `sfResponse` class has getters that return the current value of the response attributes. 
    551551 
    552 The header setters are very powerful in symfony. Headers are sent as late as possible (in the sfRenderingFilter), so you can alter them as much as you want and as late as you want. They also provide very useful shortcuts. For instance, if you don't specify a charset when you call `setContentType()`, symfony automatically adds the default charset defined in the `settings.yml` file. 
     552The header setters are very powerful in symfony. Headers are sent as late as possible (in the `sfRenderingFilter`), so you can alter them as much as you want and as late as you want. They also provide very useful shortcuts. For instance, if you don't specify a charset when you call `setContentType()`, symfony automatically adds the default charset defined in the `settings.yml` file. 
    553553 
    554554    [php] 
     
    569569You may have noticed that there are two kinds of view configuration settings: 
    570570 
    571   * The ones that have a unique value (the value is a string in the view.yml file and the response uses a `set` method for those) 
     571  * The ones that have a unique value (the value is a string in the `view.yml` file and the response uses a `set` method for those) 
    572572  * The ones with multiple values (for which `view.yml` uses arrays and the response uses an `add` method) 
    573573 
     
    622622#### Title Configuration 
    623623 
    624 The page title is a key part to search engine indexing. It is also very useful with modern browsers that provide tabbed browsing. In HTML, the title is both a tag and meta information of the page, so the `view.yml` file sees the title: key as a child of the `metas:` key. Listing 7-22 shows the title definition in `view.yml`, and Listing 7-23 shows the definition in the action. 
     624The page title is a key part to search engine indexing. It is also very useful with modern browsers that provide tabbed browsing. In HTML, the title is both a tag and meta information of the page, so the `view.yml` file sees the `title:` key as a child of the `metas:` key. Listing 7-22 shows the title definition in `view.yml`, and Listing 7-23 shows the definition in the action. 
    625625 
    626626Listing 7-22 - Title Definition in `view.yml` 
     
    670670 
    671671>**NOTE** 
    672 >Style sheet and JavaScript inclusions in the response are performed by a filter called sfCommonFilter. It looks for a `<head>` tag in the response, and adds the `<link>` and `<script>` just before the closing `</head>`. This means that the inclusion can't take place if there is no `<head>` tag in your layout or templates. 
     672>Style sheet and JavaScript inclusions in the response are performed by a filter called `sfCommonFilter`. It looks for a `<head>` tag in the response, and adds the `<link>` and `<script>` just before the closing `</head>`. This means that the inclusion can't take place if there is no `<head>` tag in your layout or templates. 
    673673 
    674674Remember that the configuration cascade principle applies, so any file inclusion defined in the application `view.yml` makes it appear in every page of the application. Listings 7-27, 7-28, and 7-29 demonstrate this principle. 
     
    960960     => sfOutputEscaperObjectDecorator 
    961961 
    962 This explains why some usual PHP functions (like `array_shift()`, `print_r()`, and so on) don't work on escaped arrays anymore. But they can be still be accessed using `[]`, be traversed using foreach, and they give back the right result with `count()` (`count()` works only with PHP 5.2 or later). And in templates, the data should be read-only anyway, so most access will be through the methods that do work. 
     962This explains why some usual PHP functions (like `array_shift()`, `print_r()`, and so on) don't work on escaped arrays anymore. But they can be still be accessed using `[]`, be traversed using `foreach`, and they give back the right result with `count()` (`count()` works only with PHP 5.2 or later). And in templates, the data should be read-only anyway, so most access will be through the methods that do work. 
    963963 
    964964You still have a way to retrieve the raw data through the `$sf_data` object. In addition, methods of escaped objects are altered to accept an additional parameter: an escaping method. So you can choose an alternative escaping method each time you display a variable in a template, or opt for the `ESC_RAW` helper to deactivate escaping. See Listing 7-46 for an example.