Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updated validation/* articles to Symfony 4#8756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:4.0fromjaviereguiluz:update_validation
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionvalidation.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,7 +132,7 @@ returned. Take this simple example from inside a controller::
use App\Entity\Author;

// ...
public functionauthorAction()
public functionauthor()
{
$author = new Author();

Expand Down
8 changes: 4 additions & 4 deletionsvalidation/custom_constraint.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -107,7 +107,7 @@ Using custom validators is very easy, just as the ones provided by Symfony itsel
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\AcmeEntity:
properties:
name:
Expand All@@ -116,7 +116,7 @@ Using custom validators is very easy, just as the ones provided by Symfony itsel
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand DownExpand Up@@ -202,14 +202,14 @@ not to the property:
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\AcmeEntity:
constraints:
-App\Validator\Constraints\ContainsAlphanumeric:~
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<classname="App\Entity\AcmeEntity">
<constraintname="App\Validator\Constraints\ContainsAlphanumeric" />
</class>
4 changes: 2 additions & 2 deletionsvalidation/groups.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ user registers and when a user updates their contact information later:
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\User:
properties:
email:
Expand All@@ -58,7 +58,7 @@ user registers and when a user updates their contact information later:
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
2 changes: 1 addition & 1 deletionvalidation/raw_values.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,7 @@ looks like this::
use Symfony\Component\Validator\Validator\ValidatorInterface;

// ...
public functionaddEmailAction($email, ValidatorInterface $validator)
public functionaddEmail($email, ValidatorInterface $validator)
{
$emailConstraint = new Assert\Email();
// all constraint "options" can be set this way
Expand Down
14 changes: 7 additions & 7 deletionsvalidation/sequence_provider.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,7 +49,7 @@ username and the password are different only if all other validation passes
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\User:
group_sequence:
-User
Expand All@@ -67,7 +67,7 @@ username and the password are different only if all other validation passes
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand DownExpand Up@@ -145,7 +145,7 @@ You can also define a group sequence in the ``validation_groups`` form option::
use Symfony\Component\Validator\Constraints\GroupSequence;
use Symfony\Component\Form\AbstractType;
// ...

class MyType extends AbstractType
{
// ...
Expand DownExpand Up@@ -195,7 +195,7 @@ entity and a new constraint group called ``Premium``:
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\User:
properties:
name:
Expand All@@ -207,7 +207,7 @@ entity and a new constraint group called ``Premium``:
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand DownExpand Up@@ -308,13 +308,13 @@ provides a sequence of groups to be validated:
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\User:
group_sequence_provider:true
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
4 changes: 2 additions & 2 deletionsvalidation/severity.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,7 +52,7 @@ Use the ``payload`` option to configure the error level for each constraint:
..code-block::yaml
#src/Resources/config/validation.yml
# config/validator/validation.yaml
App\Entity\User:
properties:
username:
Expand All@@ -70,7 +70,7 @@ Use the ``payload`` option to configure the error level for each constraint:
..code-block::xml
<!--src/Resources/config/validation.xml-->
<!-- config/validator/validation.xml-->
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mappingxmlns="http://symfony.com/schema/dic/constraint-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
8 changes: 4 additions & 4 deletionsvalidation/translations.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,13 +84,13 @@ property is not empty, add the following:
}
}
Now, create a ``validators`` catalog file in the ``config/translations/`` directory:
Now, create a ``validators`` catalog file in the ``translations/`` directory:

..configuration-block::

..code-block::xml
<!--config/translations/validators.en.xlf-->
<!-- translations/validators.en.xlf-->
<?xml version="1.0"?>
<xliffversion="1.2"xmlns="urn:oasis:names:tc:xliff:document:1.2">
<filesource-language="en"datatype="plaintext"original="file.ext">
Expand All@@ -105,12 +105,12 @@ Now, create a ``validators`` catalog file in the ``config/translations/`` direct
..code-block::yaml
#config/translations/validators.en.yaml
# translations/validators.en.yaml
author.name.not_blank:Please enter an author name.
..code-block::php
//config/translations/validators.en.php
// translations/validators.en.php
return array(
'author.name.not_blank' => 'Please enter an author name.',
);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp