Re: [fw-general] Zend_Filter_Input + Validator options.

2007-12-13 Thread SiCo007

I think the only real way to find the options for each filter / validator is
to check the code itself as only the actual filters and validators are
listed in the manual.

To send options to individual filters or validators encase it as an array.

'class_name' = array(array('Alnum', true), 'presence' = 'required');

And that will allow white space in the Alnum validator / filter (depending
on where you use it!).

To set options to be used globally, for which I believe only the meta
commands can be used I will pass you tot he manual as it's as clear as I can
make it (and I've never used it!).

http://framework.zend.com/manual/en/zend.filter.input.html#zend.filter.input.metacommands.global

I hope this answers your question.
Simon


Philip Gabbert wrote:
 
 (This is a resend cause I think I sent it under the wrong email address)
 
 This is kind of a two part question... First one is how do I find all
 the valid filter options? I see StringTrim and Digits within the
 examples, but I can't locate any list showing all possible options.
 
 Second is Validator, how do I send in options? Say, I use Alpha, but I
 want to include spaces, too.
 
 My Code looks like so:
 
  /* Validation Process */
  $filters = array ( 'class_name' = 'StringTrim' );
  $validators = array('class_name' = array('alnum', 'presence' =
 'required') );
 
  /*
   * Validate input
   *  -- I would prefer a more built in way to validate input, vs
 uses the actual
   * super global.
   */
  $input = new Zend_Filter_Input($filters, $validators, $_POST);
 
 
 I need to pass in the option to enable white space in validation. How
 would I do that?
 
 --
 Philip
 [EMAIL PROTECTED]
 http://www.gpcentre.net/
 
 


-
Simon Corless

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input-%2B-Validator-options.-tp14309591s16154p14314127.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Filter_Input + Validator options.

2007-12-12 Thread Philip G
This is kind of a two part question... First one is how do I find all
the valid filter options? I see StringTrim and Digits within the
examples, but I can't locate any list showing all possible options.

Second is Validator, how do I send in options? Say, I use Alpha, but I
want to include spaces, too.

My Code looks like so:

  /* Validation Process */
  $filters = array ( 'class_name' = 'StringTrim' );
  $validators = array('class_name' = array('alnum', 'presence' =
'required') );

  /*
   * Validate input
   *  -- I would prefer a more built in way to validate input, vs
uses the actual
   * super global.
   */
  $input = new Zend_Filter_Input($filters, $validators, $_POST);


I need to pass in the option to enable white space in validation. How
would I do that?

-- 
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/


[fw-general] Zend_Filter_Input + Validator options.

2007-12-12 Thread Philip G
(This is a resend cause I think I sent it under the wrong email address)

This is kind of a two part question... First one is how do I find all
the valid filter options? I see StringTrim and Digits within the
examples, but I can't locate any list showing all possible options.

Second is Validator, how do I send in options? Say, I use Alpha, but I
want to include spaces, too.

My Code looks like so:

 /* Validation Process */
 $filters = array ( 'class_name' = 'StringTrim' );
 $validators = array('class_name' = array('alnum', 'presence' =
'required') );

 /*
  * Validate input
  *  -- I would prefer a more built in way to validate input, vs
uses the actual
  * super global.
  */
 $input = new Zend_Filter_Input($filters, $validators, $_POST);


I need to pass in the option to enable white space in validation. How
would I do that?

--
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/