mirror of
https://github.com/Respect/Validation.git
synced 2024-06-20 06:25: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
404 B
PHP
21 lines
404 B
PHP
<?php
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
class AttributeException extends AbstractRelatedException
|
|
{
|
|
|
|
public static $defaultTemplates = array(
|
|
'"%2$s" is not present',
|
|
'"%2$s" is invalid',
|
|
);
|
|
|
|
public function chooseTemplate($input, $attributeName, $hasTheAttribute)
|
|
{
|
|
if (!$hasTheAttribute)
|
|
return 0;
|
|
else
|
|
return 1;
|
|
}
|
|
|
|
} |