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

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



Lots of ways to do, that's for sure.

I use an adapter for each data type (i.e., integer, or foreign key or an array).

I have a validate, filter and escape for each adapter.

There are two reasons I combined these into one package:

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.

 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.

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


On Wed, Apr 16, 2014 at 8:50 PM, Andrew Eddie <mamboblue AT gmail.com> wrote:
On 17 April 2014 11:44, Amy Stephen <> wrote:
> Andrew indicated he is working in this area, as well. There might be another
> option available or a way to combine work.

I've taken a slightly different approach and separated sanitisation
(filtering) from validation. So i've got a Filter package and a
Validator package.

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 a topic in the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-framework/HK9p1QaX6BA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.

--
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.