|
hi
i was reading http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html and working with that annotation builder in zf2 and doctrine without any problem i wonder if i had a zend form class ... for example class bookForm ... how can i use this annotation builder inside the class for example load basic fields from doctrine entity annotation then add some extra things (like submit button) inside the bookForm class ... in mwop.net example it use within controller ... if I add my extra form fields in that controller would be too ugly.. please help |
|
so it seems its impossible
On Wed, Aug 15, 2012 at 11:14 PM, sina miandashti <[hidden email]> wrote: > hi > > i was reading http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html and > working with that annotation builder in zf2 and doctrine without any problem > > i wonder if i had a zend form class ... for example class bookForm ... > how can i use this annotation builder inside the class > > for example load basic fields from doctrine entity annotation then add > some extra things (like submit button) inside the bookForm class ... > > in mwop.net example it use within controller ... if I add my extra form > fields in that controller would be too ugly.. > > > please help > |
|
In reply to this post by sina miandashti-3
2012/8/15 sina miandashti <[hidden email]>
> hi > > i was reading http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html and > working with that annotation builder in zf2 and doctrine without any > problem > > i wonder if i had a zend form class ... for example class bookForm ... > how can i use this annotation builder inside the class > > for example load basic fields from doctrine entity annotation then add some > extra things (like submit button) inside the bookForm class ... > > in mwop.net example it use within controller ... if I add my extra form > fields in that controller would be too ugly.. > > > please help > As far as I know, a Form extends the Fieldset class. Therefore, you could create a "master" form yourself, let a builder build another form based on your entity. You set that child form as a fieldset on your master form, where you can add additional elements. -- Jurian Sluiman |
|
final solution @ stackoverflow
http://stackoverflow.com/questions/12002722/using-annotation-builder-in-extended-zend-form-class On Fri, Aug 17, 2012 at 1:50 PM, Jurian Sluiman <[hidden email]>wrote: > 2012/8/15 sina miandashti <[hidden email]> > > > hi > > > > i was reading http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html and > > working with that annotation builder in zf2 and doctrine without any > > problem > > > > i wonder if i had a zend form class ... for example class bookForm ... > > how can i use this annotation builder inside the class > > > > for example load basic fields from doctrine entity annotation then add > some > > extra things (like submit button) inside the bookForm class ... > > > > in mwop.net example it use within controller ... if I add my extra form > > fields in that controller would be too ugly.. > > > > > > please help > > > > As far as I know, a Form extends the Fieldset class. Therefore, you could > create a "master" form yourself, let a builder build another form based on > your entity. You set that child form as a fieldset on your master form, > where you can add additional elements. > -- > Jurian Sluiman > -- ________________ Sincerely Sina Miandashti www.InTheMix.ir Admin www.teamatec.com Head PHP Developer |
|
In reply to this post by Jurian Sluiman-3
final solution @ stackoverflow
http://stackoverflow.com/questions/12002722/using-annotation-builder-in-extended-zend-form-class On Fri, Aug 17, 2012 at 1:50 PM, Jurian Sluiman <[hidden email]>wrote: > 2012/8/15 sina miandashti <[hidden email]> > > > hi > > > > i was reading http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html and > > working with that annotation builder in zf2 and doctrine without any > > problem > > > > i wonder if i had a zend form class ... for example class bookForm ... > > how can i use this annotation builder inside the class > > > > for example load basic fields from doctrine entity annotation then add > some > > extra things (like submit button) inside the bookForm class ... > > > > in mwop.net example it use within controller ... if I add my extra form > > fields in that controller would be too ugly.. > > > > > > please help > > > > As far as I know, a Form extends the Fieldset class. Therefore, you could > create a "master" form yourself, let a builder build another form based on > your entity. You set that child form as a fieldset on your master form, > where you can add additional elements. > -- > Jurian Sluiman > |
|
In reply to this post by sina miandashti
2012/8/22 sina miandashti <[hidden email]>
> final solution @ stackoverflow > > > http://stackoverflow.com/questions/12002722/using-annotation-builder-in-extended-zend-form-class Sina, if you had read my answer from 5 days ago, you would have come up with a similar approach where you did not need to loop through all elements. Forms implement fieldsets and fieldsets can be appended to forms just like elements. -- Jurian Sluiman |
|
exactly your solution
thanks but i added some codes to answer for better help on this On Wed, Aug 22, 2012 at 12:30 PM, Jurian Sluiman <[hidden email]>wrote: > 2012/8/22 sina miandashti <[hidden email]> > >> final solution @ stackoverflow >> >> >> http://stackoverflow.com/questions/12002722/using-annotation-builder-in-extended-zend-form-class > > > Sina, if you had read my answer from 5 days ago, you would have come up > with a similar approach where you did not need to loop through all > elements. Forms implement fieldsets and fieldsets can be appended to forms > just like elements. > -- > Jurian Sluiman -- ________________ Sincerely Sina Miandashti www.InTheMix.ir Admin www.teamatec.com Head PHP Developer |
| Powered by Nabble | Edit this page |
