Derick Rethans schrieb:

>> I also like to have "require_string" as a filter_type:
>> In my eyes it does not make sense to add callbacks for this but instead 
>> only strip the 'require_' part of the filter name and check the result 
>> afterwards:
>>
>> $checkEmpty = false;
>> $filterName = $inputElement->filterName;
>> if ( substr( $filterName, 0, 8 ) === 'require_' )
>> {
>>      $checkEmpty = true;
>>      $filterName = substr( $filterName, 8 );
>> }
>> // filter_input call ...
>> if ( ( $value !== null && $checkEmpty === false ) || ( $value !== null 
>> && !empty( $value ) ) )
>> {
>>      $this->properties[$elementName] = ezcInputForm::VALID;
>>      // ...
>>
>> This way the require can also be used to require other filters that 
>> output an empty string and not NULL and it doesn't add too much 
>> complexity. The usage of "require_" could of course also be restricted 
>> to them to make the usage clearer.
> 
> Could you file an issue for this please? 

I want this kind of implementation for the mentioned issue:
"#011394: UserInput::emptyValue"
http://issues.ez.no/IssueView.php?Id=11394&activeItem=2
The description of the issue is not very detailed and I guess he meant 
the same thing like me (some kind of check for empty string elements in 
the parseInput() method). I should have made this clearer in my previous 
mail.

I don't think an exception should be thrown in this case but the element 
should be marked "invalid". This makes sure my example of an intuitive 
usage of the component from my previous mail works.
I added a comment to the existing issue instead of filing a new one.

I hope you find a little time to fix that and don't insist too much on 
the "add-feature deadline" for this as it is in my eyes essential for 
proper usage of the component.

Regards
Andi

-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to