mirror of
https://github.com/Respect/Validation.git
synced 2024-06-04 14:52:17 +02:00
25 lines
745 B
PHP
25 lines
745 B
PHP
<?php
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class AlphaException extends ValidationException
|
|
{
|
|
const EXTRA = 1;
|
|
|
|
public static $defaultTemplates = array(
|
|
self::MODE_DEFAULT => array(
|
|
self::STANDARD => '{{name}} must contain only letters (a-z)',
|
|
self::EXTRA => '{{name}} must contain only letters (a-z) and "{{additionalChars}}"'
|
|
),
|
|
self::MODE_NEGATIVE => array(
|
|
self::STANDARD => '{{name}} must not contain letters (a-z)',
|
|
self::EXTRA => '{{name}} must not contain letters (a-z) or "{{additionalChars}}"'
|
|
)
|
|
);
|
|
|
|
public function chooseTemplate()
|
|
{
|
|
return $this->getParam('additionalChars') ? static::EXTRA : static::STANDARD;
|
|
}
|
|
}
|
|
|