[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] Validate, Filter, and Escape Package



On 17 April 2014 12:15, Amy Stephen <> wrote:
> 1. Many times, the code is the same -- often, a validate method will execute
> the filter method and then compare the results to the input value. If it's
> the same, it's valid. As a second example, filtering and "escaping" an
> integer is the same. Tried to keep it simple and DRY.

I know, and I did try it this way at first. But where it becomes
interesting is when you dabble into, for example, range validation,
length, etc and so on. The validation start to diverge from the
filtering.

>  2. Wanted to enable chaining. In a single call, one could validate 1) the
> value is an integer and 2) the value is a foreign key value. I've hooked it
> up to my "ORM light" so that these functions are automated on forms and
> during display.
>
> Lots of ways to do it though.

Agree.

> Link to your code? Or, is it available publicly?

Working on it.

Regards,
Andrew Eddie

-- 
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
--- 
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.