respect-validation/library/Respect/Validation/Exceptions/AttributeException.php
Alexandre (@alganet) 5830711f5a Several Improvements:
-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)
2011-01-30 22:17:06 -02:00

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;
}
}