respect-validation/library/Respect/Validation/Exceptions/DateException.php

20 lines
508 B
PHP
Raw Normal View History

2010-09-27 23:02:30 +02:00
<?php
namespace Respect\Validation\Exceptions;
class DateException extends ValidationException
2010-09-27 23:02:30 +02:00
{
2011-02-07 02:12:41 +01:00
const FORMAT = 1;
public static $defaultTemplates = array(
self::STANDARD => '%s must be a valid date',
//TODO reformat to reflect number of digits, so Y-m-d becomes YYYY-mm-dd
self::FORMAT => '%s must be a valid date in the format %s'
);
public function chooseTemplate($name, $format)
2011-02-07 02:12:41 +01:00
{
return empty($format) ? static::STANDARD : static::FORMAT;
}
2010-09-27 23:02:30 +02:00
}