validator, #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@145 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
pzinovkin
2010-04-27 23:03:54 +00:00
parent 62fc5a0a49
commit 708534a092
3 changed files with 45 additions and 3 deletions

View File

@ -29,8 +29,11 @@ abstract class Validator implements iValidator
$this->message = null;
}
public function setMessage($key, $message)
public function setMessage($message, $key = null)
{
if ($key === null) {
$key = current(array_keys($this->templates));
}
$this->templates[$key] = $message;
}