8000 merged branch jankramer/master (PR #3478) · symfony/symfony@0aac361 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0aac361

Browse files
committed
merged branch jankramer/master (PR #3478)
Commits ------- e6577de Added a 'post validation' event to the form component. Discussion ---------- [Form] Add post-validate event Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: n/a Fixes the following tickets: n/a Todo: n/a --------------------------------------------------------------------------- by fabpot at 2012-03-02T20:34:18Z ping @bschussek --------------------------------------------------------------------------- by vicb at 2012-03-04T09:19:53Z I think this is a good idea (It was something missing to properly handle PersistentFile i.e. you should not persist invalid files) --------------------------------------------------------------------------- by vicb at 2012-03-09T22:35:26Z @jankramer please remove the second commit from this PR (see http://symfony.com/doc/current/contributing/code/patches.html) in order to make this mergeable. --------------------------------------------------------------------------- by jankramer at 2012-03-10T09:26:04Z @vicb done, sorry about that commit: overlooked the fact that it was on the same branch...
2 parents 7a54fe4 + e6577de commit 0aac361

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ public function bind($clientData)
566566
foreach ($this->validators as $validator) {
567567
$validator->validate($this);
568568
}
569+
570+
$event = new DataEvent($this, $clientData);
571+
$this->dispatcher->dispatch(FormEvents::POST_VALIDATE, $event);
569572

570573
return $this;
571574
}

src/Symfony/Component/Form/FormEvents.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ final class FormEvents
2929
const BIND_NORM_DATA = 'form.bind_norm_data';
3030

3131
const SET_DATA = 'form.set_data';
32+
33+
const POST_VALIDATE = 'form.post_validate';
3234
}

0 commit comments

Comments
 (0)
0