Validates that a value is a valid language code.
.. configuration-block:: .. code-block:: yaml # src/UserBundle/Resources/config/validation.yml Acme\UserBundle\Entity\User: properties: preferredLanguage: - Language: .. code-block:: php-annotations // src/Acme/UserBundle/Entity/User.php namespace Acme\UserBundle\Entity; use Symfony\Component\Validator\Constraints as Assert; class User { /** * @Assert\Language */ protected $preferredLanguage; }
type: string
default: This value is not a valid language
This message is shown if the string is not a valid language code.