File tree Expand file tree Collapse file tree 9 files changed +51
-27
lines changed
Filter options
Expand file tree Collapse file tree 9 files changed +51
-27
lines changed
Original file line number Diff line number Diff line change @@ -49,11 +49,17 @@ form in its own PHP class::
49
49
}
50
50
}
51
51
52
+ .. best-practice ::
53
+
54
+ Put the form type classes in the ``AppBundle\Form `` namespace, unless you
55
+ use other custom form classes like data transformers.
56
+
52
57
To use the class, use ``createForm `` and instantiate the new class::
53
58
54
- use AppBundle\Form\PostType;
55
59
// ...
60
+ use AppBundle\Form\PostType;
56
61
62
+ // ...
57
63
public function newAction(Request $request)
58
64
{
59
65
$post = new Post();
Original file line number Diff line number Diff line change @@ -644,7 +644,7 @@ this method must return ``true``:
644
644
AppBundle\Entity\Author :
645
645
getters :
646
646
passwordLegal :
647
- - ' True ' : { message: 'The password cannot match your first name' }
647
+ - ' IsTrue ' : { message: 'The password cannot match your first name' }
648
648
649
649
.. code-block :: xml
650
650
@@ -656,7 +656,7 @@ this method must return ``true``:
656
656
657
657
<class name =" AppBundle\Entity\Author" >
658
658
<getter property =" passwordLegal" >
659
- <constraint name =" True " >
659
+ <constraint name =" IsTrue " >
660
660
<option name =" message" >The password cannot match your first name</option >
661
661
</constraint >
662
662
</getter >
@@ -954,7 +954,7 @@ username and the password are different only if all other validation passes
954
954
- Strict
955
955
getters :
956
956
passwordLegal :
957
- - ' True ' :
957
+ - ' IsTrue ' :
958
958
message : ' The password cannot match your username'
959
959
groups : [Strict]
960
960
properties :
@@ -981,7 +981,7 @@ username and the password are different only if all other validation passes
981
981
</property >
982
982
983
983
<getter property =" passwordLegal" >
984
- <constraint name =" True " >
984
+ <constraint name =" IsTrue " >
985
985
<option name =" message" >The password cannot match your username</option >
986
986
<option name =" groups" >
987
987
<value >Strict</value >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -74,8 +74,6 @@ backwards compatibility promise:
74
74
| Add a default value to an argument | Yes |
75
75
+-----------------------------------------------+-----------------------------+
76
76
77
- .. include :: _api_tagging.rst.inc
78
-
79
77
Using our Classes
80
78
~~~~~~~~~~~~~~~~~
81
79
@@ -134,8 +132,6 @@ covered by our backwards compatibility promise:
134
132
| Access a private property (via Reflection) | No |
135
133
+-----------------------------------------------+-----------------------------+
136
134
137
- .. include :: _api_tagging.rst.inc
138
-
139
135
Working on Symfony Code
140
136
-----------------------
141
137
Original file line number Diff line number Diff line change @@ -50,6 +50,18 @@ example containing most features described below:
50
50
$this->fooBar = $this->transformText($dummy);
51
51
}
52
52
53
+ /**
54
+ * @return string
55
+ *
56
+ * @deprecated
57
+ */
58
+ public function someDeprecatedMethod()
59
+ {
60
+ @trigger_error(sprintf('The %s() method is deprecated since version 2.8 and will be removed in 3.0. Use Acme\B az::someMethod() instead.', __METHOD__), E_USER_DEPRECATED);
61
+
62
+ return Baz::someMethod();
63
+ }
64
+
53
65
/**
54
66
* Transforms the input given as first argument.
55
67
*
@@ -151,7 +163,11 @@ Structure
151
163
* Use parentheses when instantiating classes regardless of the number of
152
164
arguments the constructor has;
153
165
154
- * Exception message strings should be concatenated using :phpfunction: `sprintf `.
166
+ * Exception and error message strings should be concatenated using :phpfunction: `sprintf `.
167
+
168
+ * Calls to :phpfunction: `trigger_error ` with type ``E_USER_DEPRECATED `` should be
169
+ switched to opt-in via ``@ `` operator.
170
+ Read more at :ref: `contributing-code-conventions-deprecations `;
155
171
156
172
Naming Conventions
157
173
------------------
Original file line number Diff line number Diff line change @@ -55,10 +55,17 @@ swiftmailer with the memory option, use the following configuration:
55
55
'spool' => array('type' => 'memory')
56
56
));
57
57
58
- Spool Using a File
58
+ .. _spool-using-a-file :
59
+
60
+ Spool Using Files
59
61
------------------
60
62
61
- In order to use the spool with a file, use the following configuration:
63
+ When you use the filesystem for spooling, Symfony creates a folder in the given
64
+ path for each mail service (e.g. "default" for the default service). This folder
65
+ will contain files for each email in the spool. So make sure this directory is
66
+ writable by Symfony (or your webserver/php)!
67
+
68
+ In order to use the spool with files, use the following configuration:
62
69
63
70
.. configuration-block ::
64
71
@@ -69,7 +76,7 @@ In order to use the spool with a file, use the following configuration:
69
76
# ...
70
77
spool :
71
78
type : file
72
- path : /path/to/spool
79
+ path : /path/to/spooldir
73
80
74
81
.. code-block :: xml
75
82
@@ -84,7 +91,7 @@ In order to use the spool with a file, use the following configuration:
84
91
<swiftmailer : config >
85
92
<swiftmailer : spool
86
93
type =" file"
87
- path =" /path/to/spool "
94
+ path =" /path/to/spooldir "
88
95
/>
89
96
</swiftmailer : config >
90
97
</container >
@@ -97,7 +104,7 @@ In order to use the spool with a file, use the following configuration:
97
104
98
105
'spool' => array(
99
106
'type' => 'file',
100
- 'path' => '/path/to/spool ',
107
+ 'path' => '/path/to/spooldir ',
101
108
),
102
109
));
103
110
Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ customize the ``name`` field only:
687
687
688
688
<!-- app/Resources/views/Form/_product_name_widget.html.php -->
689
689
<div class="text_widget">
690
- echo $view['form']->block('form_widget_simple') ?>
690
+ <?php echo $view['form']->block('form_widget_simple') ?>
691
691
</div>
692
692
693
693
Here, the ``_product_name_widget `` fragment defines the template to use for the
Original file line number Diff line number Diff line change @@ -165,10 +165,10 @@ It often happens that you use some options that are added by
165
165
:doc: `form extensions </cookbook/form/create_form_type_extension >`. One of the
166
166
cases may be the ``ValidatorExtension `` with its ``invalid_message `` option.
167
167
The ``TypeTestCase `` only loads the core form extension, which means an
168
- "Invalid option" exception will be raised if you try to test a class that
169
- depends on other extensions. The
170
- :method: `Symfony\\ Component\\ Form\\ Test\\ TypeTestCase::getExtensions ` allows you to
171
- return a list of extensions to register::
168
+ + : class: ` Symfony\\Component\\OptionsResolver\\Exception\\InvalidOptionsException `
169
+ +will be raised if you try to test a class that depends on other extensions.
170
+ +The :method: `Symfony\\ Component\\ Form\\ Test\\ TypeTestCase::getExtensions ` method
171
+ +allows you to return a list of extensions to register::
172
172
173
173
// src/AppBundle/Tests/Form/Type/TestedTypeTests.php
174
174
namespace AppBundle\Tests\Form\Type;
Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ For more details, read the article `Checking in front-end dependencies`_.
135
135
But, it's very possible that Bower will add a lock feature in the future
136
136
(e.g. `bower/bower#1748 `_).
137
137
138
+ If you don't care too much about having *exact * the same versions, you can only
139
+ commit the ``bower.json `` file. Running ``bower install `` will give you the
140
+ latest versions within the specified version range of each package in
141
+ ``bower.json ``. Using strict version constraints (e.g. ``1.10.* ``) is often
142
+ enough to ensure only bringing in compatible versions.
143
+
138
144
.. _Bower : http://bower.io
139
145
.. _`Node.js` : https://nodejs.org
140
146
.. _BowerPHP : http://bowerphp.org/
You can’t perform that action at this time.
0 commit comments