mirror of
https://github.com/Respect/Validation.git
synced 2024-06-27 09:40:05 +02:00
-Several improvements on the messaging system and error reporting, lots of refactored code. -Validators can now be safely named $val->setName('My Field'), and that name will reflect on the validation message ("My Field must be bla bla bla" instead of "incorrect value" must be bla bla bla)
19 lines
425 B
PHP
19 lines
425 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class NotEmptyException extends ValidationException
|
|
{
|
|
const STANDARD = 0;
|
|
const NAMED = 1;
|
|
public static $defaultTemplates = array(
|
|
self::STANDARD => 'The value must not be empty',
|
|
self::NAMED => '%s must not be empty',
|
|
);
|
|
|
|
public function chooseTemplate($name)
|
|
{
|
|
return empty($name) ? static::STANDARD : static::NAMED;
|
|
}
|
|
|
|
} |