mirror of
https://github.com/Respect/Validation.git
synced 2024-06-27 01:30:05 +02:00
5830711f5a
-Simplified defaultTemplates on Exceptions -Exceptions now can be iterated and recursively iterated -Messages built by RecursiveTreeIterator (SPL), faster an simpler -attribute, key and composite exceptions message plays nicer (no redundant messages)
21 lines
457 B
PHP
21 lines
457 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class AlnumException extends ValidationException
|
|
{
|
|
|
|
public static $defaultTemplates = array(
|
|
'"%s" does not contain only letters and digits',
|
|
'"%s" does not contain only letters, digits and "%s"'
|
|
);
|
|
|
|
public function chooseTemplate($input, $additionalCharacters=null)
|
|
{
|
|
if (empty($additionalCharacters))
|
|
return 0;
|
|
else
|
|
return 1;
|
|
}
|
|
|
|
} |