Re: [fw-general] Zend_Filter_Input()

2007-08-15 Thread ivo trompert



Brenton Alker wrote:
 
 
 ivo trompert wrote:
 
 
 ...
 
 But the problem now is that if I give the second field a message (the
 second field is the 'username') like this:
 
 'name' = array('NotEmpty', 'messages' = 'Voornaam is verplicht!'),
  'username' = array('NotEmtpy', 'messages' = 'De 
 gebruikers naam
 is verplicht!'),
  'password1' = array('Alpha', 'allowEmpty'= true),
  'password2' = array('allowEmpty' = true)
  );
 I get the folowing error:
 
 Fatal error: Uncaught exception 'Zend_Filter_Exception' with message
 'Unable to find the implementation of the 'NotEmtpy' class' in
 /storage/wwwroot/Zend/Filter/Input.php:830 Stack trace: #0 
 
 ...
  
 What is wrong with this code?
 
 
 
 It's Just a simple typo by the looks.
 
 
 'username' = array('NotEmtpy', 'messages' = 'De gebruikers naam is
 verplicht!'),
 
 Fatal error: Uncaught exception 'Zend_Filter_Exception' with message
 'Unable to find the implementation of the 'NotEmtpy' class' in
 /storage/wwwroot/Zend/Filter/Input.php:830 Stack trace: #0
 
 
 You've got NotEmtpy instead of NotEmpty.
 
 
 

Thank you that was the problem.

Ivo Trompert

-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input%28%29-tf4269740s16154.html#a12158145
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Filter_Input()

2007-08-14 Thread ivo trompert

For Zend_Filter_Input() I need a custom error message because I'm dutch and
the website I make is also dutch. I have setup validators as follows:

$validators = array(
'name' = array('allowEmpty' = false,
'username' = array('Alpha','allowEmpty' = false),
'password1' = array('Alpha', 'allowEmpty' = true),
'password2' = array('allowEmpty' = true)
);

If 'name' is empty I want to show the users the following error Voornaam is
verplicht! (this is dutch). I have read in the user manual the following
code:

$validators = array(
'month' = array(
'digits', new Zend_Validate_Between(1, 12),
'messages' = array(
'A month must consist only of digits',
array(
Zend_Validate_Between::NOT_BETWEEN =
'Month value %value% must be between %min% and %max%',
Zend_Validate_Between::NOT_BETWEEN_STRICT =
'Month value %value% must be strictly between %min% and
%max%'
)
)
)
);

This is the code I need for the custom message. But when I transform the
code to this code:

'name' = array('allowEmpty' = false, 'messages' =
array(Zend_Validate_NotEmpty::IS_EMPTY = 'Voornaam is verplicht!')),
'username' = array('Alpha','allowEmpty' = false),
'password1' = array('Alpha', 'allowEmpty' = true),
'password2' = array('allowEmpty' = true)
);

I get the standard error message:You must give a non-empty value for field
'name'.

My question is: How can I change this message field independent (with out
setup a message in the option section).

Thank you,

Ivo Trompert
-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input%28%29-tf4269740s16154.html#a12152306
Sent from the Zend Framework mailing list archive at Nabble.com.