Skip to content

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Mar 19, 2014
2 parents 450146e + 15b813f commit e40733d
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 60 deletions.
9 changes: 9 additions & 0 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,15 @@ If there are any issues, correct them now before moving on.

Note that using the ACL is recommended when you have access to them
on your server because changing the umask is not thread-safe.

**4. Use the same user for the CLI and the web server**

In development environments, it is a common practice to use the same unix
user for the CLI and the web server because it avoids any of these permissions
issues when setting up new projects. This can be done by editing your web server
configuration (e.g. commonly httpd.conf or apache2.conf for Apache) and setting
its user to be the same as your CLI user (e.g. for Apache, update the User
and Group values).

When everything is fine, click on "Go to the Welcome page" to request your
first "real" Symfony2 webpage:
Expand Down
48 changes: 23 additions & 25 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1268,29 +1268,6 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
For more information, see the documentation for that bundle.

.. index::
single: Routing; Absolute URLs

Generating Absolute URLs
~~~~~~~~~~~~~~~~~~~~~~~~

By default, the router will generate relative URLs (e.g. ``/blog``). To generate
an absolute URL, simply pass ``true`` to the third argument of the ``generate()``
method::

$this->get('router')->generate('blog_show', array('slug' => 'my-blog-post'), true);
// http://www.example.com/blog/my-blog-post

.. note::

The host that's used when generating an absolute URL is the host of
the current ``Request`` object. This is detected automatically based
on server information supplied by PHP. When generating absolute URLs for
scripts run from the command line, you'll need to manually set the desired
host on the ``RequestContext`` object::

$this->get('router')->getContext()->setHost('www.example.com');

.. index::
single: Routing; Generating URLs in a template

Expand All @@ -1303,7 +1280,7 @@ But if you pass extra ones, they will be added to the URI as a query string::
$this->get('router')->generate('blog', array('page' => 2, 'category' => 'Symfony'));
// /blog/2?category=Symfony

Generating URLs from a template
Generating URLs from a Template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The most common place to generate a URL is from within a template when linking
Expand All @@ -1326,7 +1303,20 @@ a template helper function:
Read this blog post.
</a>

Absolute URLs can also be generated.
.. index::
single: Routing; Absolute URLs

Generating Absolute URLs
~~~~~~~~~~~~~~~~~~~~~~~~

By default, the router will generate relative URLs (e.g. ``/blog``). From
a controller, simply pass ``true`` to the third argument of the ``generateUrl()``
method::

$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
// http://www.example.com/blog/my-blog-post

From a template, it looks like this:

.. configuration-block::

Expand All @@ -1344,6 +1334,14 @@ Absolute URLs can also be generated.
Read this blog post.
</a>

.. note::

The host that's used when generating an absolute URL is the host of
the current ``Request`` object. This is detected automatically. But if
you generate absolute URLs for scripts run from the command line, this
won't work. But don't worry! Just see :doc:`/cookbook/console/sending_emails`
for details.

Summary
-------

Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The second method has several specific advantages:
.. seealso::

For parameter handling within a Dependency Injection class see
:doc:`</cookbook/configuration/using_parameters_in_dic>`.
:doc:`/cookbook/configuration/using_parameters_in_dic`.

.. index::
single: Bundle; Extension
Expand Down
2 changes: 1 addition & 1 deletion cookbook/routing/service_container_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ path):
.. seealso::

For parameter handling within a Dependency Injection class see
:doc:`</cookbook/configuration/using_parameters_in_dic>`.
:doc:`/cookbook/configuration/using_parameters_in_dic`.
21 changes: 10 additions & 11 deletions reference/forms/types/button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ A simple, non-responsive button.
+----------------------+----------------------------------------------------------------------+
| Rendered as | ``button`` tag |
+----------------------+----------------------------------------------------------------------+
| Options | - `attr`_ |
| | - `disabled`_ |
| Inherited | - `attr`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `translation_domain`_ |
+----------------------+----------------------------------------------------------------------+
| Overridden options | - `auto_initialize`_ |
+----------------------+----------------------------------------------------------------------+
| Parent type | none |
+----------------------+----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` |
+----------------------+----------------------------------------------------------------------+

Options
-------
Inherited options
-----------------

The following options are defined in the
:class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BaseType` class.
The ``BaseType`` class is the parent class for both the ``button`` type and
the :doc:`form type </reference/forms/types/form>`, but it is not part of
the form type tree (i.e. it can not be used as a form type on its own).

.. include:: /reference/forms/types/options/button_attr.rst.inc

Expand All @@ -34,8 +38,3 @@ Options
.. include:: /reference/forms/types/options/button_label.rst.inc

.. include:: /reference/forms/types/options/button_translation_domain.rst.inc

Overridden Options
------------------

.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc
78 changes: 65 additions & 13 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,47 @@
form Field Type
===============

See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.

The ``form`` type predefines a couple of options that are then available
on all fields.
on all types for which ``form`` is the parent type.

+-----------+--------------------------------------------------------------------+
| Options | - `compound`_ |
| | - `data`_ |
| | - `data_class`_ |
| | - `empty_data`_ |
| | - `required`_ |
| | - `label_attr`_ |
| | - `constraints`_ |
| | - `cascade_validation`_ |
| | - `read_only`_ |
| | - `trim`_ |
| | - `mapped`_ |
| | - `property_path`_ |
| | - `max_length`_ |
| | - `by_reference`_ |
| | - `error_bubbling`_ |
| | - `inherit_data`_ |
| | - `error_mapping`_ |
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `extra_fields_message`_ |
| | - `post_max_size_message`_ |
| | - `pattern`_ |
+-----------+--------------------------------------------------------------------+
| Inherited | - `block_name`_ |
| options | - `disabled`_ |
| | - `label`_ |
| | - `attr`_ |
| | - `translation_domain`_ |
| | - `auto_initialize`_ |
+-----------+--------------------------------------------------------------------+
| Parent | none |
+-----------+--------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType` |
+-----------+--------------------------------------------------------------------+

Options
-------

.. include:: /reference/forms/types/options/data.rst.inc

Expand All @@ -25,8 +62,6 @@ on all fields.

.. include:: /reference/forms/types/options/required.rst.inc

.. include:: /reference/forms/types/options/label.rst.inc

.. include:: /reference/forms/types/options/label_attr.rst.inc

.. include:: /reference/forms/types/options/constraints.rst.inc
Expand All @@ -35,20 +70,12 @@ on all fields.

.. include:: /reference/forms/types/options/read_only.rst.inc

.. include:: /reference/forms/types/options/disabled.rst.inc

.. include:: /reference/forms/types/options/trim.rst.inc

.. include:: /reference/forms/types/options/mapped.rst.inc

.. include:: /reference/forms/types/options/property_path.rst.inc

.. include:: /reference/forms/types/options/attr.rst.inc

.. include:: /reference/forms/types/options/translation_domain.rst.inc

.. include:: /reference/forms/types/options/block_name.rst.inc

.. _reference-form-option-max_length:

.. include:: /reference/forms/types/options/max_length.rst.inc
Expand All @@ -72,3 +99,28 @@ on all fields.
.. _reference-form-option-pattern:

.. include:: /reference/forms/types/options/pattern.rst.inc

.. include:: /reference/forms/types/options/action.rst.inc

.. include:: /reference/forms/types/options/method.rst.inc

Inherited options
-----------------

The following options are defined in the
:class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BaseType` class.
The ``BaseType`` class is the parent class for both the ``form`` type and
the :doc:`button type </reference/forms/types/button>`, but it is not part
of the form type tree (i.e. it can not be used as a form type on its own).

.. include:: /reference/forms/types/options/block_name.rst.inc

.. include:: /reference/forms/types/options/disabled.rst.inc

.. include:: /reference/forms/types/options/label.rst.inc

.. include:: /reference/forms/types/options/attr.rst.inc

.. include:: /reference/forms/types/options/translation_domain.rst.inc

.. include:: /reference/forms/types/options/auto_initialize.rst.inc
8 changes: 8 additions & 0 deletions reference/forms/types/options/auto_initialize.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
auto_initialize
~~~~~~~~~~~~~~~

**type**: ``boolean`` **default**: ``true``

An internal option: sets whether the form should be initialized automatically.
For all fields, this option should only be ``true`` for root forms. You won't
need to change this option and probably won't need to worry about it.
9 changes: 0 additions & 9 deletions reference/forms/types/options/button_auto_initialize.rst.inc

This file was deleted.

0 comments on commit e40733d

Please sign in to comment.