2009-10-01 7 views
0

Zend_Filter_Input을 사용하여 등록 프로세스의 입력을 살균합니다. 내 코드는 그래서 다음과 같습니다Zend_Filter_Input을 사용한 사용자 정의 오류 메시지

$validators = array(
     'user_id'=> array(
       array('Alnum', TRUE), 
       'NotEmpty', 
       'presence' => 'required', 
       'messages'=>array('Your username can contain only alphabetic or numeric letters, and must be between 3 and 20 characters.'), 
       array('StringLength', 3, 20) 
      ), 
'first_name'=>array(
       array('Alpha', TRUE), 
       'NotEmpty', 
       'presence' => 'required', 
      'messages'=>array('Your first name can contain only contain alphabetic letters, and must be between 3 and 20 characters.'), 
       array('StringLength', 3, 20) 
      ), 

내가 젠드 필터의 중 하나가 실패 할 경우 너무 반환하는 오류 메시지를 사용자 정의하고 싶습니다, 그것은 '메시지'아래에있는 텍스트를 표시합니다. 'NotEmpty', 'Presence'또는 StringLength 조건이 충족되면 자체 오류 메시지를 표시하고 'Alnum'필터가 실패하면 내 메시지 만 표시합니다. 의 조건이 충족되면 메시지 만 표시하려면 어떻게해야합니까?

감사합니다.

답변

관련 문제