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

Tweak the IsTrue validation docs#12712

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
Merged
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
13 changes: 6 additions & 7 deletionsreference/constraints/IsTrue.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
IsTrue
======

Validates that a value is ``true``. Specifically, this checks to see if
the value is exactly ``true``, exactly the integer ``1``, or exactly the
string "``1``".
Validates that a value is ``true``. Specifically, this checks if the value is
exactly ``true``, exactly the integer ``1``, or exactly the string ``"1"``.

Also see :doc:`IsFalse <IsFalse>`.

Expand All@@ -23,9 +22,9 @@ Basic Usage
-----------

This constraint can be applied to properties (e.g. a ``termsAccepted`` property
on a registration model)or to a "getter" method. It's most powerful in
the latter case,where you can assert that a method returns a true value.
For example, supposeyou have the following method::
on a registration model)and methods. It's most powerful in the latter case,
where you can assert that a method returns a true value. For example, suppose
you have the following method::

// src/AppBundle/Entity/Author.php
namespace AppBundle\Entity;
Expand All@@ -40,7 +39,7 @@ For example, suppose you have the following method::
}
}

Then you canconstrain this method with ``IsTrue``.
Then you canvalidate this method with ``IsTrue`` as follows:

.. configuration-block::

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp