Symfony Reloaded 2.0 Preview Release

Please note that Symfony2 is not ready for production yet. The final release is planned for late 2010 and will only support PHP 5.3.2 and up. In the meantime, we highly encourage you to use the current symfony 1.4 stable release for all your projects.

Documentation Format

The Symfony2 documentation uses reStructuredText as its markup language and Sphinx for building the output (HTML, PDF, ...).

reStructuredText

reStructuredText “is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system.”

You can learn more about its syntax by reading existing Symfony2 documents or by reading the reStructuredText Primer on the Sphinx website.

If you are familiar with Markdown, be careful as things as sometimes very similar but different:

  • Lists starts at the beginning of a line (no indentation is allowed);
  • Inline code blocks use double-ticks (``like this``).

Sphinx

Sphinx is a build system that adds some nice tools to create documentation from reStructuredText documents. As such, it adds new directives and interpreted text roles to standard reST markup.

Syntax Highlighting

All code examples uses PHP as the default highlighted language. You can change it with the code-block directive:

.. code-block:: yaml

    { foo: bar, bar: { foo: bar, bar: baz } }

If your PHP code begins with <?php, then you need to use html+php as the highlighted pseudo-language:

.. code-block:: html+php

    <?php echo $this->foobar(); ?>

Note

A list of supported languages is available on the Pygments website.

Configuration Blocks

Whenever you show a configuration, you must use the configuration-block directive to show the configuration in all supported configuration formats (PHP, YAML, and XML):

.. configuration-block::

    .. code-block:: yaml

        # Configuration in YAML

    .. code-block:: xml

        <!-- Configuration in XML //-->

    .. code-block:: php

        // Configuration in XML

The previous reST snippet renders as follow:

  • YAML
    # Configuration in YAML
    
  • XML
    <!-- Configuration in XML //-->
    
  • PHP
    // Configuration in XML
    
Creative Commons License This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
© 2010 Fabien Potencier - "Symfony" is a trademark of Fabien Potencier, all rights reserved. Documentation powered by Sphinx.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.