forms common functions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

forms common functions

diego
Hi

i have procedures common to several forms. how can i create a class with
this common function and call them from every form... like a "form helper"

thank you


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: forms common functions

H Glenn Hatfield
On Mon, May 9, 2011 at 9:22 AM, Diego Garcia <[hidden email]> wrote:

> Hi
>
> i have procedures common to several forms. how can i create a class with
> this common function and call them from every form... like a "form helper"
>

You'll probably need to subclass Zend_Form to do this and then have your
forms extend your class. I don't remember Zend_Form having a helper
construct built in. Where I work, we have some logic relating to CSRF that
we need each form to have and subclassing has worked great for us.

H Hatfield
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: forms common functions

diego
ok, i´ll do that. thanx
El 09/05/2011 03:22 p.m., H Hatfield escribió:

> On Mon, May 9, 2011 at 9:22 AM, Diego Garcia<[hidden email]>  wrote:
>
>> Hi
>>
>> i have procedures common to several forms. how can i create a class with
>> this common function and call them from every form... like a "form helper"
>>
>
> You'll probably need to subclass Zend_Form to do this and then have your
> forms extend your class. I don't remember Zend_Form having a helper
> construct built in. Where I work, we have some logic relating to CSRF that
> we need each form to have and subclassing has worked great for us.
>
> H Hatfield
> [hidden email]
>



--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]