Filters: ------- $Id: filters.txt 2 2004-02-29 18:58:13Z schst $ Filters can be used to modify the value while it is sent to the end user or when the end user sends a value to the form. Filters are objects that supply at least the following three methods: 1. integer patForms_Filter::getType() Returns the type of the filter, either PATFORMS_FILTER_TYPE_HTTP or PATFORMS_FILTER_TYPE_PHP. If a filter is of type HTTP, it is located between the patForms_Element object and the browser of the user, that means the value will be filtered directly when it has been submitted. If a filter is of type PHP, it is located between the patForms_Element and the PHP script you developed. That means after the form is submitted, the value will be validated and only filtered, when you call patForms_Element::getValue() 2. mixed in( mixed value ) This method is called when data is pushed to the patForms_Element object. For PHP filters this is when you call patForms_Element::setValue(), or when you have set a default value. For HTTP filters, it is called when the user submitted data to the form. 3. mixed out( mixed value ) This method is called when data is pulled from the patForms_Element object. For PHP filters this is when you call patForms_Element::getValue(). For HTTP filters, it is invoked when the form element is generated. The easiest way to create a custom filter is to derive it from patForms_Filter.