Can't customize personalized error rendering in symfony 1.4
I am trying to set up error rendering in my form according to this example .
Here is my code:
if ($this['message']->hasError()) {
$error_msg = '<ul>';
foreach ($this['message']->getError() as $error) $error_msg .= "<li>$error</li>";
$error_msg .= '</ul>';
}
return $error_msg;
but when $this['message']
has an error, this code returns '<ul></ul>'
, so it foreach ($this['message']->getError() as $error)
doesn't seem to call iterations
$this['message']->getError()
returns an object sfValidatorError
- maybe something changed in symfony 1.4 and it no longer iterates ...
At first I thought that all the magic in this example was due to the fact that the object is being put into $error
iteration implements __toString (), but it seems that no iterations happen at all ...
a source to share