2
/* Form Elements & Other Definitions Here ... */
$this->setAction("auth")
->setMethod("post")
->setAttrib("class","ajax_form");
$email = new Zend_Form_Element_Text("email");
$email->setAttrib("class","text_input")
->setLabel("E-Mail")
->addValidator("EmailAddress","NotEmpty")
->isRequired(true);
$password = new Zend_Form_Element_Password("password");
$password->setAttrib("class","text_input")
->setLabel("Password")
->addValidator("NotEmpty")
->isRequired(true);
$this->addElements(array($email,$password));
$this->setDecorators(array(
'FormElements',
'FormErrors',
array('HtmlTag',array('tag'=>'<table>')),
'Form'
));
$this->setElementDecorators(array(
'ViewHelper',
array(array('data'=>'HtmlTag'), array('tag'=>'td')),
array('Label',array('tag'=>'td')),
array(array('row'=>'HtmlTag'), array('tag'=>'tr'))
));
1 줄 코딩시이 양식의 모든 요소에 클래스 "text_input"을 추가하고 싶습니다. 각 요소에 setAtttrib을 사용하고 싶지 않습니다. 어쨌든 ? 나는 젠드에서 새로운 사람입니다.젠드 양식 요소 모든 요소의 속성 추가
ty, 정말 루프를 사용하지 않는 것입니다. 그러나 알고있는 것이 좋다. –