diff --git a/reference/forms/types/checkbox.rst b/reference/forms/types/checkbox.rst index eeddb8031de..79ef36875a4 100644 --- a/reference/forms/types/checkbox.rst +++ b/reference/forms/types/checkbox.rst @@ -5,8 +5,8 @@ checkbox Field Type =================== Creates a single input checkbox. This should always be used for a field that -has a Boolean value: if the box is checked, the field will be set to true, -if the box is unchecked, the value will be set to false. +has a ``Boolean`` value: if the box is checked, the field will be set to ``true``, +if the box is unchecked, the value will be set to ``false``. +-------------+------------------------------------------------------------------------+ | Rendered as | ``input`` ``checkbox`` field | @@ -37,8 +37,8 @@ Example Usage .. code-block:: php $builder->add('public', 'checkbox', array( - 'label' => 'Show this entry publicly?', - 'required' => false, + 'label' => 'Show this entry publicly?', + 'required' => false, )); Field Options diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index a5757116817..57ca2f18247 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -51,8 +51,8 @@ user sees on the form (e.g. ``Male``). .. code-block:: php $builder->add('gender', 'choice', array( - 'choices' => array('m' => 'Male', 'f' => 'Female'), - 'required' => false, + 'choices' => array('m' => 'Male', 'f' => 'Female'), + 'required' => false, )); By setting ``multiple`` to true, you can allow the user to choose multiple @@ -62,12 +62,12 @@ of checkboxes depending on the ``expanded`` option: .. code-block:: php $builder->add('availability', 'choice', array( - 'choices' => array( + 'choices' => array( 'morning' => 'Morning', 'afternoon' => 'Afternoon', 'evening' => 'Evening', ), - 'multiple' => true, + 'multiple' => true, )); You can also use the ``choice_list`` option, which takes an object that can @@ -86,11 +86,11 @@ choices **type**: ``array`` **default**: ``array()`` This is the most basic way to specify the choices that should be used -by this field. The ``choices`` option is an array, where the array key +by this field. The ``choices`` option is an ``array``, where the array key is the item value and the array value is the item's label:: $builder->add('gender', 'choice', array( - 'choices' => array('m' => 'Male', 'f' => 'Female') + 'choices' => array('m' => 'Male', 'f' => 'Female'), )); .. tip:: @@ -111,7 +111,7 @@ The ``choice_list`` option must be an instance of the ``ChoiceListInterface``. For more advanced cases, a custom class that implements the interface can be created to supply the choices. -With this option you can also allow float values to be selected as data. +With this option you can also allow ``float`` values to be selected as data. .. code-block:: php diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 16cf2dc0a16..b4c45bd1161 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -76,7 +76,7 @@ option. The easiest way to use the option is as follows:: $builder->add('users', 'entity', array( 'class' => 'AcmeHelloBundle:User', - 'query_builder' => function(EntityRepository $er) { + 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('u') ->orderBy('u.username', 'ASC'); }, @@ -131,7 +131,7 @@ This is a property path (e.g. ``author.name``) used to organize the available choices in groups. It only works when rendered as a select tag and does so by adding ``optgroup`` elements around options. Choices that do not return a value for this property path are rendered directly under the -select tag, without a surrounding optgroup. +``select`` tag, without a surrounding ``optgroup``. property ~~~~~~~~ @@ -140,7 +140,7 @@ property This is the property that should be used for displaying the entities as text in the HTML element. If left blank, the entity object will be -cast into a string and so must have a ``__toString()`` method. +cast into a ``string`` and so must have a ``__toString()`` method. .. note:: @@ -159,11 +159,11 @@ cast into a string and so must have a ``__toString()`` method. query_builder ~~~~~~~~~~~~~ -**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure +**type**: ``Doctrine\ORM\QueryBuilder`` or a ``Closure`` If specified, this is used to query the subset of options (and their order) that should be used for the field. The value of this option can -either be a ``QueryBuilder`` object or a Closure. If using a Closure, +either be a ``QueryBuilder`` object or a ``Closure``. If using a ``Closure``, it should take a single argument, which is the ``EntityRepository`` of the entity. diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 6db6ead9c06..6e824367425 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -50,7 +50,7 @@ the currency symbol that should be shown by the text box. Depending on the currency - the currency symbol may be shown before or after the input text field. -This can be any `3 letter ISO 4217 code`_. You can also set this to false to +This can be any `3 letter ISO 4217 code`_. You can also set this to ``false`` to hide the currency symbol. divisor diff --git a/reference/forms/types/options/attr.rst.inc b/reference/forms/types/options/attr.rst.inc index 03a13d4b9b6..bbee5888a4a 100644 --- a/reference/forms/types/options/attr.rst.inc +++ b/reference/forms/types/options/attr.rst.inc @@ -1,7 +1,7 @@ attr ~~~~ -**type**: array **default**: Empty array +**type**: ``array`` **default**: ``array()`` If you want to add extra attributes to an HTML field representation you can use the ``attr`` option. It's an associative array with HTML attributes diff --git a/reference/forms/types/options/by_reference.rst.inc b/reference/forms/types/options/by_reference.rst.inc index 3e7987addb9..6c2840b076d 100644 --- a/reference/forms/types/options/by_reference.rst.inc +++ b/reference/forms/types/options/by_reference.rst.inc @@ -19,7 +19,7 @@ To explain this further, here's a simple example:: ->add('email', 'email') ) -If ``by_reference`` is true, the following takes place behind the scenes +If ``by_reference`` is ``true``, the following takes place behind the scenes when you call ``submit()`` (or ``handleRequest()``) on the form:: $article->setTitle('...'); @@ -28,7 +28,7 @@ when you call ``submit()`` (or ``handleRequest()``) on the form:: Notice that ``setAuthor()`` is not called. The author is modified by reference. -If you set ``by_reference`` to false, submitting looks like this:: +If you set ``by_reference`` to ``false``, submitting looks like this:: $article->setTitle('...'); $author = $article->getAuthor(); diff --git a/reference/forms/types/options/cascade_validation.rst.inc b/reference/forms/types/options/cascade_validation.rst.inc index c41b605f9f6..a7754e09fe5 100644 --- a/reference/forms/types/options/cascade_validation.rst.inc +++ b/reference/forms/types/options/cascade_validation.rst.inc @@ -1,7 +1,7 @@ cascade_validation ~~~~~~~~~~~~~~~~~~ -**type**: Boolean **default**: false +**type**: ``Boolean`` **default**: ``false`` Set this option to ``true`` to force validation on embedded form types. For example, if you have a ``ProductType`` with an embedded ``CategoryType``, diff --git a/reference/forms/types/options/expanded.rst.inc b/reference/forms/types/options/expanded.rst.inc index e41c28a5da4..0791a0cb918 100644 --- a/reference/forms/types/options/expanded.rst.inc +++ b/reference/forms/types/options/expanded.rst.inc @@ -3,5 +3,5 @@ expanded **type**: ``Boolean`` **default**: ``false`` -If set to true, radio buttons or checkboxes will be rendered (depending -on the ``multiple`` value). If false, a select element will be rendered. +If set to ``true``, radio buttons or checkboxes will be rendered (depending +on the ``multiple`` value). If ``false``, a ``select`` element will be rendered. diff --git a/reference/forms/types/options/label.rst.inc b/reference/forms/types/options/label.rst.inc index 3adff95fbf0..537dcd61d65 100644 --- a/reference/forms/types/options/label.rst.inc +++ b/reference/forms/types/options/label.rst.inc @@ -3,7 +3,7 @@ label **type**: ``string`` **default**: The label is "guessed" from the field name -Sets the label that will be used when rendering the field. Setting to false +Sets the label that will be used when rendering the field. Setting to ``false`` will suppress the label. The label can also be directly set inside the template: .. configuration-block:: diff --git a/reference/forms/types/options/multiple.rst.inc b/reference/forms/types/options/multiple.rst.inc index f5a61f28012..dd7679f4d04 100644 --- a/reference/forms/types/options/multiple.rst.inc +++ b/reference/forms/types/options/multiple.rst.inc @@ -3,7 +3,7 @@ multiple **type**: ``Boolean`` **default**: ``false`` -If true, the user will be able to select multiple options (as opposed +If ``true``, the user will be able to select multiple options (as opposed to choosing just one option). Depending on the value of the ``expanded`` -option, this will render either a select tag or checkboxes if true and -a select tag or radio buttons if false. The returned value will be an array. +option, this will render either a ``select`` tag or checkboxes if ``true`` and +a ``select`` tag or radio buttons if ``false``. The returned value will be an ``array``. diff --git a/reference/forms/types/options/preferred_choices.rst.inc b/reference/forms/types/options/preferred_choices.rst.inc index 96f8268546c..644a59cdf2c 100644 --- a/reference/forms/types/options/preferred_choices.rst.inc +++ b/reference/forms/types/options/preferred_choices.rst.inc @@ -13,7 +13,7 @@ to the top, with a visual separator between it and the rest of the options:: )); Note that preferred choices are only meaningful when rendering as a ``select`` -element (i.e. ``expanded`` is false). The preferred choices and normal choices +element (i.e. ``expanded`` is ``false``). The preferred choices and normal choices are separated visually by a set of dotted lines (i.e. ``-------------------``). This can be customized when rendering the field: diff --git a/reference/forms/types/options/read_only.rst.inc b/reference/forms/types/options/read_only.rst.inc index d1c2101591c..78061ba79f2 100644 --- a/reference/forms/types/options/read_only.rst.inc +++ b/reference/forms/types/options/read_only.rst.inc @@ -3,5 +3,5 @@ read_only **type**: ``Boolean`` **default**: ``false`` -If this option is true, the field will be rendered with the ``readonly`` +If this option is ``true``, the field will be rendered with the ``readonly`` attribute so that the field is not editable. diff --git a/reference/forms/types/options/required.rst.inc b/reference/forms/types/options/required.rst.inc index 8a4f7321da3..4f76e9a916b 100644 --- a/reference/forms/types/options/required.rst.inc +++ b/reference/forms/types/options/required.rst.inc @@ -3,7 +3,7 @@ required **type**: ``Boolean`` **default**: ``true`` -If true, an `HTML5 required attribute`_ will be rendered. The corresponding +If ``true``, an `HTML5 required attribute`_ will be rendered. The corresponding ``label`` will also render with a ``required`` class. This is superficial and independent from validation. At best, if you let Symfony diff --git a/reference/forms/types/options/trim.rst.inc b/reference/forms/types/options/trim.rst.inc index 68ba656be94..0a82270bca4 100644 --- a/reference/forms/types/options/trim.rst.inc +++ b/reference/forms/types/options/trim.rst.inc @@ -3,7 +3,7 @@ trim **type**: ``Boolean`` **default**: ``true`` -If true, the whitespace of the submitted string value will be stripped +If ``true``, the whitespace of the submitted string value will be stripped via the ``trim()`` function when the data is bound. This guarantees that if a value is submitted with extra whitespace, it will be removed before the value is merged back onto the underlying object. diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index eefe8eb7c31..95e339b39a7 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -36,12 +36,12 @@ always_empty **type**: ``Boolean`` **default**: ``true`` -If set to true, the field will *always* render blank, even if the corresponding -field has a value. When set to false, the password field will be rendered +If set to ``true``, the field will *always* render blank, even if the corresponding +field has a value. When set to ``false``, the password field will be rendered with the ``value`` attribute set to its true value only upon submission. Put simply, if for some reason you want to render your password field -*with* the password value already entered into the box, set this to false +*with* the password value already entered into the box, set this to ``false`` and submit the form. diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index 253a43c69b5..6b30dca5ff6 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -53,7 +53,7 @@ type **type**: ``string`` **default**: ``fractional`` This controls how your data is stored on your object. For example, a percentage -corresponding to "55%", might be stored as ``.55`` or ``55`` on your +corresponding to "``55%``", might be stored as ``.55`` or ``55`` on your object. The two "types" handle these two cases: * ``fractional`` @@ -63,7 +63,7 @@ object. The two "types" handle these two cases: on form submit so that the decimal value is stored (``.55``); * ``integer`` - If your data is stored as an integer (e.g. 55), then use this option. + If your data is stored as an integer (e.g. ``55``), then use this option. The raw value (``55``) is shown to the user and stored on your object. Note that this only works for integer values.