Skip to content

Commit 29d1970

Browse files
author
pvanliefland
committed
[#814] [Form] Fine-tuned punctuations and style
1 parent 4634ce3 commit 29d1970

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cookbook/form/create_form_type_extension.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ extensions come in.
1515
Form type extensions have 2 main use cases:
1616

1717
#. You want to add a **generic feature to several types** (such as
18-
adding a "help" text to every field type)
18+
adding a "help" text to every field type);
1919
#. You want to add a **specific feature to a single type** (such
20-
as adding a "download" feature to the "file" field type)
20+
as adding a "download" feature to the "file" field type).
2121

2222
In both those cases, it might be possible to achieve your goal with custom
2323
form rendering, or custom form field types. But using form type extensions
@@ -56,7 +56,6 @@ That's what you will do in this tutorial::
5656

5757
class ImageTypeExtension extends AbstractTypeExtension
5858
{
59-
6059
/**
6160
* Returns the name of the type being extended.
6261
*
@@ -154,7 +153,6 @@ database).
154153
*/
155154
class Media
156155
{
157-
158156
// ...
159157
160158
/**
@@ -186,10 +184,10 @@ database).
186184
187185
Your form type extension class will need to do two things:
188186

189-
1) Override the ``getDefaultOptions`` method in order to add an image_path
190-
option
191-
2) Override the ``buildForm`` and ``buildView`` methods in order to pass the image
192-
url to the view
187+
#. Override the ``getDefaultOptions`` method in order to add an image_path
188+
option;
189+
#. Override the ``buildForm`` and ``buildView`` methods in order to pass the image
190+
url to the view.
193191

194192
The logic is the following: when adding a form field of type ``file``,
195193
you will be able to specify a new option: ``image_path``. This option will
@@ -209,7 +207,6 @@ it in the view.
209207
210208
class ImageTypeExtension extends AbstractTypeExtension
211209
{
212-
213210
/**
214211
* Returns the name of the type being extended.
215212
*
@@ -311,7 +308,6 @@ next to the file field. As an example::
311308

312309
class MediaType extends AbstractType
313310
{
314-
315311
public function buildForm(FormBuilder $builder, array $options)
316312
{
317313
$builder

0 commit comments

Comments
 (0)