Commit 800912d3 authored by Fabien Potencier's avatar Fabien Potencier

Merge branch '1.3'

* 1.3:
  Fix env variable in travis.yaml
  bumped version to 1.3.6-DEV
  prepared the 1.3.5 release
  updated CHANGELOG
  Replace binary gender examples with something that is actually single-choice
  Update validator.rst
parents 5a7a491f c5fabd12
......@@ -24,6 +24,6 @@ matrix:
- php: 5.6
env: SYMFONY_DEPS_VERSION=2.8
- php: 5.6
env: SYMFONY_DEPS_VERSION=3
env: SYMFONY_DEPS_VERSION=3.0
- php: 7.0
- php: hhvm
......@@ -24,11 +24,16 @@ Changelog
* ``monolog.exception.logger_filter`` option added to Monolog service provider
* [BC BREAK] ``$app['request']`` service removed, use ``$app['request_stack']`` instead
1.3.5 (2015-XX-XX)
1.3.6 (2016-XX-XX)
------------------
* n/a
1.3.5 (2016-01-06)
------------------
* fixed typo in SecurityServiceProvider
1.3.4 (2015-09-15)
------------------
......
......@@ -80,8 +80,8 @@ example::
$form = $app['form.factory']->createBuilder('form', $data)
->add('name')
->add('email')
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
->add('billing_plan', 'choice', array(
'choices' => array(1 => 'free', 2 => 'small_business', 3 => 'corporate'),
'expanded' => true,
))
->getForm();
......@@ -128,10 +128,10 @@ form by adding constraints on the fields::
->add('email', 'text', array(
'constraints' => new Assert\Email()
))
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
->add('billing_plan', 'choice', array(
'choices' => array(1 => 'free', 2 => 'small_business', 3 => 'corporate'),
'expanded' => true,
'constraints' => new Assert\Choice(array(1, 2)),
'constraints' => new Assert\Choice(array(1, 2, 3)),
))
->getForm();
......
......@@ -48,13 +48,13 @@ The Validator provider provides a ``validator`` service.
Validating Values
~~~~~~~~~~~~~~~~~
You can validate values directly using the ``validateValue`` validator
You can validate values directly using the ``validate`` validator
method::
use Symfony\Component\Validator\Constraints as Assert;
$app->get('/validate/{email}', function ($email) use ($app) {
$errors = $app['validator']->validateValue($email, new Assert\Email());
$errors = $app['validator']->validate($email, new Assert\Email());
if (count($errors) > 0) {
return (string) $errors;
......@@ -86,7 +86,7 @@ collection of constraints::
'last_name' => new Assert\Length(array('min' => 10)),
)),
));
$errors = $app['validator']->validateValue($book, $constraint);
$errors = $app['validator']->validate($book, $constraint);
if (count($errors) > 0) {
foreach ($errors as $error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment