8000 Update translation.rst by solazs · Pull Request #4989 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update translation.rst #4989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
265604b
[#4243] Tweaks to the new var-dumper component
weaverryan Nov 5, 2014
09a6fd7
[Form] Add entity manager instance support for em option
GeLoLabs Oct 18, 2014
1a29f24
typos in the var-dumper component
nicolas-grekas Nov 8, 2014
9caea6f
feature #4336 [Form] Add entity manager instance support for em optio…
weaverryan Nov 13, 2014
3329bd2
feature #4424 [#4243] Tweaks to the new var-dumper component (weaverr…
weaverryan Nov 13, 2014
0d5cb0d
Merge branch '2.7'
weaverryan Nov 13, 2014
0c92fab
Merge branch '2.7'
weaverryan Nov 13, 2014
51224e9
Merge branch '2.7'
wouterj Nov 19, 2014
d6ce29f
Merge branch '2.7'
weaverryan Nov 24, 2014
f24b645
Merge branch '2.7'
weaverryan Nov 24, 2014
d969e8b
Merge branch '2.7'
weaverryan Nov 25, 2014
0fb81cc
Merge branch '2.7'
weaverryan Nov 25, 2014
6b73990
Merge branch '2.7'
wouterj Dec 1, 2014
8099ac1
Merge branch '2.7'
weaverryan Dec 4, 2014
486baf8
Merge branch '2.7'
wouterj Dec 7, 2014
d921dcd
Merge branch '2.7'
wouterj Dec 7, 2014
f0ac8bb
Merge branch '2.7'
weaverryan Dec 7, 2014
3454883
Merge branch '2.7'
weaverryan Dec 7, 2014
d30dc9e
Merge remote-tracking branch 'origin/master'
weaverryan Dec 8, 2014
2d1c336
Merge branch '2.7'
weaverryan Dec 11, 2014
e539bd1
Merge branch '2.7'
weaverryan Dec 20, 2014
0906e0c
Merge branch '2.7'
weaverryan Dec 21, 2014
4056218
Merge branch '2.7'
weaverryan Dec 23, 2014
07aa543
Merge branch '2.7'
weaverryan Dec 26, 2014
2fcebc1
Merge branch '2.7'
wouterj Dec 28, 2014
8131844
Merge branch '2.7'
weaverryan Dec 29, 2014
cb6f846
Merge branch '2.7'
weaverryan Dec 31, 2014
9e5fc6c
Merge branch '2.7'
weaverryan Dec 31, 2014
56db7af
Merge branch '2.7'
weaverryan Dec 31, 2014
27296ad
Merge branch '2.7'
wouterj Dec 31, 2014
353995e
Merge branch '2.7'
weaverryan Jan 1, 2015
fcfea43
Merge branch '2.7'
wouterj Jan 2, 2015
6ef6a04
Merge branch '2.7'
weaverryan Jan 3, 2015
bcab77b
bump Symfony requirements to PHP 5.5
xabbuh Jan 4, 2015
d33b78b
don't describe removed usage of Yaml::parse()
xabbuh Jan 4, 2015
6f9832d
Merge branch '2.7'
wouterj Jan 4, 2015
42d2b15
Merge branch '2.7'
weaverryan Jan 4, 2015
7d2f0f3
Removed 2.5 versionadded as its deprecated
wouterj Jan 4, 2015
92b10b1
bug #4758 [Components][Yaml] don't describe removed usage of Yaml::pa…
wouterj Jan 8, 2015
032a6b4
Merge branch '2.7'
wouterj Jan 8, 2015
c859790
Fixed markup
wouterj Jan 9, 2015
9919bca
Revert "Fixed markup"
wouterj Jan 9, 2015
ca3b4c8
feature #4753 bump Symfony requirements to PHP 5.5 (xabbuh)
wouterj Jan 16, 2015
a17bdd7
Merge branch '2.7'
wouterj Jan 16, 2015
dc25c65
minor #4769 [2.7] Removed 2.5 versionadded as its deprecated (WouterJ)
weaverryan Jan 16, 2015
050f7ce
Documented true regex
wouterj Jan 18, 2015
7363c9b
Merge branch '2.6' into 2.7
weaverryan Jan 18, 2015
907ee0d
Merge branch '2.7'
weaverryan Jan 18, 2015
728205f
Replaced setDefaultOptions by the new configureOptions method
peterrehm Jan 6, 2015
74d2e30
feature #4786 Replaced setDefaultOptions by the new configureOptions …
weaverryan Jan 21, 2015
885c378
[#4786] Adding a few versionadded's for the changed method name
weaverryan Jan 21, 2015
e4d22f0
added documentation for the new absolute_url() and relative_path() Tw…
fabpot Jan 10, 2015
6e6bae8
Small grammar-ish fix
wouterj Jan 25, 2015
6c498d4
feature #4805 added documentation for the new absolute_url() and rela…
weaverryan Jan 25, 2015
8fe9069
added documentation for the new absolute_url() and relative_path() Tw…
fabpot Jan 10, 2015
a5addaa
[#4805] Adding versionadded
weaverryan Jan 25, 2015
61ea87b
Merge branch '2.6' into 2.7
weaverryan Jan 25, 2015
c33b371
Merge branch '2.7'
weaverryan Jan 25, 2015
7c07a44
Merge branch '2.6' into 2.7
wea 8000 verryan Jan 25, 2015
99e2996
Merge branch '2.7'
weaverryan Jan 25, 2015
a57db5b
feature #4879 Documented true regex (WouterJ)
weaverryan Jan 30, 2015
39f6876
Merge branch '2.6' into 2.7
weaverryan Jan 30, 2015
714f630
Merge branch '2.7'
weaverryan Jan 30, 2015
bc29584
Merge branch '2.6' into 2.7
wouterj Jan 30, 2015
87eb36c
Merge branch '2.7'
wouterj Jan 30, 2015
d71fe6d
Merge branch '2.6' into 2.7
wouterj Feb 1, 2015
c0f9f67
Merge branch '2.7'
wouterj Feb 1, 2015
78f4f69
Merge branch '2.6' into 2.7
wouterj Feb 1, 2015
ebe2706
Added January changelog
wouterj Feb 1, 2015
ad97700
Merge branch '2.7'
wouterj Feb 1, 2015
6fd286b
Added January changelog
wouterj Feb 1, 2015
7f8d6bd
Merge branch '2.6' into 2.7
wouterj Feb 1, 2015
8d56ad7
Merge branch '2.7'
wouterj Feb 1, 2015
ef39a01
Remove diff
wouterj Feb 1, 2015
70902f5
Merge branch '2.6' into 2.7
weaverryan Feb 1, 2015
81e8c13
Merge branch '2.7'
weaverryan Feb 1, 2015
b7f7421
Update translation.rst
solazs Feb 11, 2015
94914c5
Review note about setting the translator locale in a controller.
solazs Feb 15, 2015
d5566b1
Finaly touches on translation locale setting note
solazs Feb 20, 2015
fdae4bc
Merge branch 'master' of https://github.com/solazs/symfony-docs into …
solazs Mar 6, 2015
cbc91e3
Remove useless setLocale() call and add code block with locale setter
solazs Mar 6, 2015
30b4dfa
Revert "Merge branch 'master' of https://github.com/solazs/symfony-do…
solazs Mar 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ form in its own PHP class::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class PostType extends AbstractType
{
Expand All @@ -36,7 +36,7 @@ form in its own PHP class::
;
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Post'
Expand Down
38 changes: 21 additions & 17 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,17 @@ you'll need to specify which validation group(s) your form should use::
'validation_groups' => array('registration'),
))->add(...);

.. versionadded:: 2.7
The ``configureOptions()`` method was introduced in Symfony 2.7. Previously,
the method was called ``setDefaultOptions()``.

If you're creating :ref:`form classes <book-form-creating-form-classes>` (a
good practice), then you'll need to add the following to the ``setDefaultOptions()``
good practice), then you'll need to add the following to the ``configureOptions()``
method::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => array('registration'),
Expand All @@ -498,9 +502,9 @@ Disabling Validation
Sometimes it is useful to suppress the validation of a form altogether. For
these cases you can set the ``validation_groups`` option to ``false``::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => false,
Expand All @@ -524,10 +528,10 @@ If you need some advanced logic to determine the validation groups (e.g.
based on submitted data), you can set the ``validation_groups`` option
to an array callback::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

// ...
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => array(
Expand All @@ -544,10 +548,10 @@ You can also define whole logic inline by using a ``Closure``::

use Acme\AcmeBundle\Entity\Client;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

// ...
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => function(FormInterface $form) {
Expand All @@ -567,10 +571,10 @@ of the entity as well you have to adjust the option as follows::

use Acme\AcmeBundle\Entity\Client;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

// ...
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'validation_groups' => function(FormInterface $form) {
Expand Down Expand Up @@ -1090,9 +1094,9 @@ the choice is ultimately up to you.
good idea to explicitly specify the ``data_class`` option by adding the
following to your form type class::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Task',
Expand Down Expand Up @@ -1321,7 +1325,7 @@ create a form class so that a ``Category`` object can be modified by the user::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CategoryType extends AbstractType
{
Expand All @@ -1330,7 +1334,7 @@ create a form class so that a ``Category`` object can be modified by the user::
$builder->add('name');
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
A3E2 'data_class' => 'AppBundle\Entity\Category',
Expand Down Expand Up @@ -1756,13 +1760,13 @@ that all un-rendered fields are output.

The CSRF token can be customized on a form-by-form basis. For example::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TaskType extends AbstractType
{
// ...

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Task',
Expand Down
4 changes: 2 additions & 2 deletions cookbook/doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Next, create the form for the ``User`` model::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class UserType extends AbstractType
{
Expand All @@ -125,7 +125,7 @@ Next, create the form for the ``User`` model::
));
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\AccountBundle\Entity\User'
Expand Down
14 changes: 9 additions & 5 deletions cookbook/form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ for form fields, which is ``<BundleName>\Form\Type``. Make sure the field extend
namespace AppBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class GenderType extends AbstractType
{
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'choices' => array(
Expand Down Expand Up @@ -72,7 +72,11 @@ important:
set) the ``multiple`` attribute on the ``select`` field. See `Creating a Template for the Field`_
for more details.

``setDefaultOptions()``
.. versionadded:: 2.7
The ``configureOptions()`` method was introduced in Symfony 2.7. Previously,
the method was called ``setDefaultOptions()``.

``configureOptions()``
This defines options for your form type that
can be used in ``buildForm()`` and ``buildView()``. There are a lot of
options common to all fields (see :doc:`/reference/forms/types/form`),
Expand Down Expand Up @@ -345,7 +349,7 @@ method to ``GenderType``, which receives the gender configuration::
// src/AppBundle/Form/Type/GenderType.php
namespace AppBundle\Form\Type;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

// ...

Expand All @@ -359,7 +363,7 @@ method to ``GenderType``, which receives the gender configuration::
$this->genderChoices = $genderChoices;
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'choices' => $this->genderChoices,
Expand Down
8 changes: 4 additions & 4 deletions cookbook/form/create_form_type_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ to override one of the following methods:

* ``buildView()``

* ``setDefaultOptions()``
* ``configureOptions()``

* ``finishView()``

Expand Down Expand Up @@ -178,7 +178,7 @@ database)::
Your form type extension class will need to do two things in order to extend
the ``file`` form type:

#. Override the ``setDefaultOptions`` method in order to add an ``image_path``
#. Override the ``configureOptions`` method in order to add an ``image_path``
option;
#. Override the ``buildForm`` and ``buildView`` methods in order to pass the image
URL to the view.
Expand Down Expand Up @@ -212,9 +212,9 @@ it in the view::
/**
* Add the image_path option
*
* @param OptionsResolverInterface $resolver
* @param OptionsResolver $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setOptional(array('image_path'));
}
Expand Down
9 changes: 5 additions & 4 deletions cookbook/form/data_transformers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ You can also use transformers without creating a new custom form type
by calling ``addModelTransformer`` (or ``addViewTransformer`` - see
`Model and View Transformers`_) on any field builder::

use Symfony\Component\Form\FormBuilderInterface;
use Acme\TaskBundle\Form\DataTransformer\IssueToNumberTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TaskType extends AbstractType
{
Expand All @@ -133,7 +134,7 @@ by calling ``addModelTransformer`` (or ``addViewTransformer`` - see
);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults(array(
Expand Down Expand Up @@ -254,7 +255,7 @@ First, create the custom field type class::
use Symfony\Component\Form\FormBuilderInterface;
use Acme\TaskBundle\Form\DataTransformer\IssueToNumberTransformer;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class IssueSelectorType extends AbstractType
{
Expand All @@ -277,7 +278,7 @@ First, create the custom field type class::
$builder->addModelTransformer($transformer);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'The selected issue does not exist',
Expand Down
9 changes: 2 additions & 7 deletions cookbook/form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ a bare form class looks like::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ProductType extends AbstractType
{
Expand All @@ -51,7 +51,7 @@ a bare form class looks like::
$builder->add('price');
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Product'
Expand Down Expand Up @@ -224,7 +224,6 @@ Using an event listener, your form might look like this::
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class FriendMessageFormType extends AbstractType
{
Expand All @@ -243,10 +242,6 @@ Using an event listener, your form might look like this::
{
return 'friend_message';
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
{
}
}

The problem is now to get the current user and create a choice field that
Expand Down
8 changes: 4 additions & 4 deletions cookbook/form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Then, create a form class so that a ``Tag`` object can be modified by the user::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TagType extends AbstractType
{
Expand All @@ -93,7 +93,7 @@ Then, create a form class so that a ``Tag`` object can be modified by the user::
$builder->add('name');
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\TaskBundle\Entity\Tag',
Expand All @@ -118,7 +118,7 @@ Notice that you embed a collection of ``TagType`` forms using the

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TaskType extends AbstractType
{
Expand All @@ -129,7 +129,7 @@ Notice that you embed a collection of ``TagType`` forms using the
$builder->add('tags', 'collection', array('type' => new TagType()));
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\TaskBundle\Entity\Task',
Expand Down
4 changes: 2 additio 10000 ns & 2 deletions cookbook/form/inherit_data_option.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ for that::

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class LocationType extends AbstractType
{
Expand All @@ -103,7 +103,7 @@ for that::
->add('country', 'text');
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'inherit_data' => true
Expand Down
8 changes: 4 additions & 4 deletions cookbook/form/use_empty_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ that constructor with no arguments::
// ...
use Symfony\Component\Form\AbstractType;
use AppBundle\Entity\Blog;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class BlogType extends AbstractType
{
Expand All @@ -51,7 +51,7 @@ that constructor with no arguments::
}
// ...

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'empty_data' => new Blog($this->someDependency),
Expand All @@ -72,11 +72,11 @@ if it is needed.

The closure must accept a ``FormInterface`` instance as the first argument::

use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormInterface;
// ...

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'empty_data' => function (FormInterface $form) {
Expand Down
2 changes: 1 addition & 1 deletion reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ the interface directly::
class MyFormTypeExtension extends AbstractTypeExtension
{
// ... fill in whatever methods you want to override
// like buildForm(), buildView(), finishView(), setDefaultOptions()
// like buildForm(), buildView(), finishView(), configureOptions()
}

In order for Symfony to know about your form extension and use it, give it
Expand Down
Loading
0