views:

33

answers:

2
if(count($this->form->email->getMessages()) > 0)
                        {
                            $e = '<ul>';
                                $m = $this->form->email->getMessages();
                                foreach($m as $me)
                                {
                                    $e .= '<li>';
                                        $e .= $me;
                                    $e .= '</li>';
                                }
                            $e .= '</ul>';                          
                            echo $e;
                            unset($e);
                            unset($m);
                        }

I'm currenly passing form object to VIEW and echo every elemen manually.

But when comes to errors, it takes a lot of code to write.

Could someone tell, how to output errors for each element without such amount of code?

Thanks!

Here is the picture of all decorators before the output:

alt text

A: 

this is impossible since to havent provided your current decorator. However, you should add the helper

Errors

to the decorator.

Laykes
Just a second, i will post a picture.
Beck
Yea helper is one way. :)Passing it an object of current element and returning already generated list of errors in needed wrapper.But question is still open. How to output them already generated by zend decorator.
Beck
+1  A: 

Found amazing method:

renderFormErrors();

Just what i was looking for. :)

But for individual outputing, can be used decorator. Found on this forum.

Beck