Skip to content

Commit 90b2803

Browse files
committed
Merge pull request #1854 from richardmiller/removing_apostrophes
Removing a couple of incorrect apostrophes
2 parents d269056 + f2c9ec1 commit 90b2803

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

cookbook/event_dispatcher/before_after_filters.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ How to setup before and after Filters
55
=====================================
66

77
It is quite common in web application development to need some logic to be
8-
executed just before or just after your controller actions acting as filters
8+
executed just before or just after your controller actions acting as filters
99
or hooks.
1010

1111
In symfony1, this was achieved with the preExecute and postExecute methods.
@@ -180,7 +180,7 @@ your listener to be called just before any controller is executed.
180180
With this configuration, your ``TokenListener`` ``onKernelController`` method
181181
will be executed on each request. If the controller that is about to be executed
182182
implements ``TokenAuthenticatedController``, token authentication is
183-
applied. This let's us have a "before" filter on any controller that you
183+
applied. This lets us have a "before" filter on any controller that you
184184
want.
185185

186186
After filters with the ``kernel.response`` Event
@@ -277,4 +277,4 @@ executed (``onKernelController``) and after every controller returns a response
277277
(``onKernelResponse``). By making specific controllers implement the ``TokenAuthenticatedController``
278278
interface, our listener knows which controllers it should take action on.
279279
And by storing a value in the request's "attributes" bag, the ``onKernelResponse``
280-
method knows to add the extra header. Have fun!
280+
method knows to add the extra header. Have fun!

cookbook/form/dynamic_form_generation.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
How to Dynamically Generate Forms Using Form Events
55
===================================================
66

7-
Before jumping right into dynamic form generation, let's have a quick review
7+
Before jumping right into dynamic form generation, let's have a quick review
88
of what a bare form class looks like::
99

1010
// src/Acme/DemoBundle/Form/Type/ProductType.php
1111
namespace Acme\DemoBundle\Form\Type;
1212

1313
use Symfony\Component\Form\AbstractType;
1414
use Symfony\Component\Form\FormBuilder;
15-
15+
1616
class ProductType extends AbstractType
1717
{
1818
public function buildForm(FormBuilder $builder, array $options)
@@ -29,28 +29,28 @@ of what a bare form class looks like::
2929

3030
.. note::
3131

32-
If this particular section of code isn't already familiar to you, you
33-
probably need to take a step back and first review the :doc:`Forms chapter </book/forms>`
32+
If this particular section of code isn't already familiar to you, you
33+
probably need to take a step back and first review the :doc:`Forms chapter </book/forms>`
3434
before proceeding.
3535

3636
Let's assume for a moment that this form utilizes an imaginary "Product" class
37-
that has only two relevant properties ("name" and "price"). The form generated
37+
that has only two relevant properties ("name" and "price"). The form generated
3838
from this class will look the exact same regardless of a new Product is being created
3939
or if an existing product is being edited (e.g. a product fetched from the database).
4040

41-
Suppose now, that you don't want the user to be able to change the ``name`` value
41+
Suppose now, that you don't want the user to be able to change the ``name`` value
4242
once the object has been created. To do this, you can rely on Symfony's :doc:`Event Dispatcher </components/event_dispatcher/introduction>`
43-
system to analyze the data on the object and modify the form based on the
44-
Product object's data. In this entry, you'll learn how to add this level of
43+
system to analyze the data on the object and modify the form based on the
44+
Product object's data. In this entry, you'll learn how to add this level of
4545
flexibility to your forms.
4646

4747
.. _`cookbook-forms-event-subscriber`:
4848

4949
Adding An Event Subscriber To A Form Class
5050
------------------------------------------
5151

52-
So, instead of directly adding that "name" widget via our ProductType form
53-
class, let's delegate the responsibility of creating that particular field
52+
So, instead of directly adding that "name" widget via our ProductType form
53+
class, let's delegate the responsibility of creating that particular field
5454
to an Event Subscriber::
5555

5656
// src/Acme/DemoBundle/Form/Type/ProductType.php
@@ -75,8 +75,8 @@ to an Event Subscriber::
7575
}
7676
}
7777

78-
The event subscriber is passed the FormFactory object in its constructor so
79-
that our new subscriber is capable of creating the form widget once it is
78+
The event subscriber is passed the FormFactory object in its constructor so
79+
that our new subscriber is capable of creating the form widget once it is
8080
notified of the dispatched event during form creation.
8181

8282
.. _`cookbook-forms-inside-subscriber-class`:
@@ -119,8 +119,8 @@ might look like the following::
119119

120120
// During form creation setData() is called with null as an argument
121121
// by the FormBuilder constructor. We're only concerned with when
122-
// setData is called with an actual Entity object in it (whether new,
123-
// or fetched with Doctrine). This if statement let's us skip right
122+
// setData is called with an actual Entity object in it (whether new
123+
// or fetched with Doctrine). This if statement lets us skip right
124124
// over the null condition.
125125
if (null === $data) {
126126
return;
@@ -135,27 +135,27 @@ might look like the following::
135135

136136
.. caution::
137137

138-
It is easy to misunderstand the purpose of the ``if (null === $data)`` segment
139-
of this event subscriber. To fully understand its role, you might consider
140-
also taking a look at the `Form class`_ and paying special attention to
141-
where setData() is called at the end of the constructor, as well as the
138+
It is easy to misunderstand the purpose of the ``if (null === $data)`` segment
139+
of this event subscriber. To fully understand its role, you might consider
140+
also taking a look at the `Form class`_ and paying special attention to
141+
where setData() is called at the end of the constructor, as well as the
142142
setData() method itself.
143143

144-
The ``FormEvents::PRE_SET_DATA`` line actually resolves to the string ``form.pre_set_data``.
144+
The ``FormEvents::PRE_SET_DATA`` line actually resolves to the string ``form.pre_set_data``.
145145
The `FormEvents class`_ serves an organizational purpose. It is a centralized location
146146
in which you can find all of the various form events available.
147147

148-
While this example could have used the ``form.set_data`` event or even the ``form.post_set_data``
149-
events just as effectively, by using ``form.pre_set_data`` we guarantee that
150-
the data being retrieved from the ``Event`` object has in no way been modified
151-
by any other subscribers or listeners. This is because ``form.pre_set_data``
152-
passes a `DataEvent`_ object instead of the `FilterDataEvent`_ object passed
153-
by the ``form.set_data`` event. `DataEvent`_, unlike its child `FilterDataEvent`_,
148+
While this example could have used the ``form.set_data`` event or even the ``form.post_set_data``
149+
events just as effectively, by using ``form.pre_set_data`` we guarantee that
150+
the data being retrieved from the ``Event`` object has in no way been modified
151+
by any other subscribers or listeners. This is because ``form.pre_set_data``
152+
passes a `DataEvent`_ object instead of the `FilterDataEvent`_ object passed
153+
by the ``form.set_data`` event. `DataEvent`_, unlike its child `FilterDataEvent`_,
154154
lacks a setData() method.
155155

156156
.. note::
157157

158-
You may view the full list of form events via the `FormEvents class`_,
158+
You may view the full list of form events via the `FormEvents class`_,
159159
found in the form bundle.
160160

161161
.. _`DataEvent`: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Event/DataEvent.php

0 commit comments

Comments
 (0)