Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
ZendInput and empty values
Aug 04, 2015 @ 15:49:15

Rob Allen has a post to his site to help clear up some confusion with how the ZendInput component handles "empty" between the required, allow_empty and continue_if_empty logic.

These settings define what happens when you try to validate an empty value for a given input. For ZendInput, empty means exactly equal to null, an empty string or an empty array.

He starts by outlining each of the three settings including both their default settings and its intent. He gets into a bit more detail on continue_if_empty as it has additional logic that depends on the results of the other two settings. He includes a small test application that cycles through a set of values and evaluates them through a ZendInput instance. The output is also included in the post so you can verify your system is seeing the same evaluation results.

tagged: zendinput empty value evaluation required allowempty continueifempty tutorial

Link: http://akrabat.com/zend-input-empty-values/


Trending Topics: