@@ -186,17 +186,17 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
186
186
// this file comes with TwigBridge
187
187
$defaultFormTheme = 'form_div_layout.html.twig';
188
188
189
- $vendorDir = realpath(__DIR__ . '/../vendor');
189
+ $vendorDir = realpath(__DIR__. '/../vendor');
190
190
// the path to TwigBridge so Twig can locate the
191
191
// form_div_layout.html.twig file
192
192
$vendorTwigBridgeDir =
193
- $vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
193
+ $vendorDir. '/symfony/twig-bridge/Symfony/Bridge/Twig';
194
194
// the path to your other templates
195
- $viewsDir = realpath(__DIR__ . '/../views');
195
+ $viewsDir = realpath(__DIR__. '/../views');
196
196
197
197
$twig = new Twig_Environment(new Twig_Loader_Filesystem(array(
198
198
$viewsDir,
199
- $vendorTwigBridgeDir . '/Resources/views/Form',
199
+ $vendorTwigBridgeDir. '/Resources/views/Form',
200
200
)));
201
201
$formEngine = new TwigRendererEngine(array($defaultFormTheme));
202
202
$formEngine->setEnvironment($twig);
@@ -315,24 +315,24 @@ Your integration with the Validation component will look something like this::
315
315
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
316
316
use Symfony\Component\Validator\Validation;
317
317
318
- $vendorDir = realpath(__DIR__ . '/../vendor');
319
- $vendorFormDir = $vendorDir . '/symfony/form/Symfony/Component/Form';
318
+ $vendorDir = realpath(__DIR__. '/../vendor');
319
+ $vendorFormDir = $vendorDir. '/symfony/form/Symfony/Component/Form';
320
320
$vendorValidatorDir =
321
- $vendorDir . '/symfony/validator/Symfony/Component/Validator';
321
+ $vendorDir. '/symfony/validator/Symfony/Component/Validator';
322
322
323
323
// create the validator - details will vary
324
324
$validator = Validation::createValidator();
325
325
326
326
// there are built-in translations for the core error messages
327
327
$translator->addResource(
328
328
'xlf',
329
- $vendorFormDir . '/Resources/translations/validators.en.xlf',
329
+ $vendorFormDir. '/Resources/translations/validators.en.xlf',
330
330
'en',
331
331
'validators'
332
332
);
333
333
$translator->addResource(
334
334
'xlf',
335
- $vendorValidatorDir . '/Resources/translations/validators.en.xlf',
335
+ $vendorValidatorDir. '/Resources/translations/validators.en.xlf',
336
336
'en',
337
337
'validators'
338
338
);
@@ -671,10 +671,12 @@ object::
671
671
672
672
// ...
673
673
674
- // an array of FormError objects, but only errors attached to this form level (e.g. "global errors)
674
+ // an array of FormError objects, but only errors attached to this
675
+ // form level (e.g. "global errors)
675
676
$errors = $form->getErrors();
676
677
677
- // an array of FormError objects, but only errors attached to the "firstName" field
678
+ // an array of FormError objects, but only errors attached to the
679
+ // "firstName" field
678
680
$errors = $form['firstName']->getErrors();
679
681
680
682
// a string representation of all errors of the whole form tree
0 commit comments