« Return to Thread: How to use a custom Validator with a non-zend/mvc application

Re: How to use a custom Validator with a non-zend/mvc application

by mnaveed :: Rate this Message:

Reply to Author | View in Thread


Writing the custom validator is same but how I am going to use it in my page? It shows some zend exception from loader. I think i need to define the path some how? In examples on net i have seen something like $element->pathPrefix..(...) to set the path for custom validator, But here i dont have any Zend form or zend form element. So how do i register my custome validator?

Thanks.


David Mintz-2 wrote:
On Tue, Jun 30, 2009 at 7:36 AM, mnaveed <mnaveed_19@hotmail.com> wrote:

>
> Can anyone please guide me how to use a custom validator with an exisiting
> application. Please note that the application is not using Zend MVC modal
> and zend forms.
> I am able to use the builtin validations/filters to validate my data but
> not
> been able to use a custom validator.
>

I'd think you would do the same as you would in a full-blown ZF project:
extend Zend_Validate_Abstract  (or implement Zend_Validate_Interface) and
away you go.

http://framework.zend.com/manual/en/zend.validate.writing_validators.html


--
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness

 « Return to Thread: How to use a custom Validator with a non-zend/mvc application