以实例为说明:
controller
add(new Text("name", array( "maxlength" => 20, "placeholder"=>'you name' ))); //例子二: $form->add(new Text("telphone")); //例子三: //例子三我有不明白的地方,该怎么调用他的验证。 $passwd = new Text("passwd"); $passwd->addValidator(new PresenceOf(array( 'message' => 'The passwd is required' ))); $passwd->addValidator(new StringLength(array( 'min' => 10, 'messageMinimum' => 'The passwd is too short' ))); $form->add($passwd); $this->view->pick("form/form"); $this->view->form=$form; } }?>
phtml
aaa tag->form("form/test");?> render("name") ?> render("telphone", array("maxlength"=>20, "placeholder"=>"you telphone"));?> render("passwd") ?> tag->submitButton("login");?>