getCode(), ': ', $e->getMessage();
}
var_dump( 42.4 );
?>
|
new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'float' ),
'test2' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::OPTIONAL, 'float' ),
'test3' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::OPTIONAL, 'float' ),
'test4' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::OPTIONAL, 'int', array( 1, 2 ) ),
);
$form = new ezcInputForm( INPUT_POST, $def );
echo "Valid properties:\n";
var_dump( $form->getValidProperties() );
echo "Invalid properties:\n";
var_dump( $form->getInvalidProperties() );
echo "Required properties:\n";
var_dump( $form->getRequiredProperties() );
echo "Optional properties:\n";
var_dump( $form->getOptionalProperties() );
echo "Values:\n";
var_dump( $form->test1 );
try
{
var_dump( $form->test2 );
}
catch ( ezcInputFormException $e )
{
echo $e->getCode(), ': ', $e->getMessage();
}
var_dump( $form->test3 );
?>
|