Hi,

please read this tutorial. It contains your answer.

http://www.michaelgallego.fr/blog/?p=190

lukm

On Wed, Aug 29, 2012 at 4:58 PM, krmarien [via Zend Framework Community] <
ml-node+s634137n4656577...@n4.nabble.com> wrote:

> Hi,
>
> In the beta releases of ZF2 there was a DisplayGroup for forms, but this
> disappeared.
> I think Collection is the successor of it, but I can't get it work....
>
> If I add this to my form:
>
>     $collection = new Collection('university');
>     $collection->setLabel('University');
>     $this->add($collection);
>
>     $field = new Text('university_identification');
>     $field->setLabel('Identification')
>         ->setRequired();
>     $collection->add($field);
>
>     $field = new Select('university_status');
>     $field->setLabel('Status')
>         ->setRequired()
>         ->setAttribute('options', University::$possibleStatuses);
>     $collection->add($field);
>
> It is displayed like I want, but if I submit the form I get the following
> error:
>
>     Fatal error: __clone method called on non-object in
> /Users/krmarien/Sites/Litus/vendor/zendframework/zendframework/library/Zend/Form/Element/Collection.php
> on line 514
>
> How do I need to implement the collection?
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Form-Collections-tp4656577.html
>  To unsubscribe from Zend Framework Community, click 
> here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=bHVjYXMubWllcnp3YUBnbWFpbC5jb218NjM0MTM3fC0xNTg3NzMzNzEw>
> .
> NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Re-ZF2-Form-Collections-tp4656639.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to