小さなアプリを開発しています。PHPとZend Frameworkを使用しています。フォームがあり、そのコントローラーを使用してフォームを表示します。ここで、フォーム データを操作し、それに応じてユーザーをリダイレクトする必要があります。これが私のコントローラーです
<?php
class NewuserController extends Zend_Controller_Action {
public function init()
{
/* Initialize action controller here */
}
public function newuserAction()
{
$this->view->newuser;
}
public function adduserAction(){
$data = $this->getRequest()->getParams();
$u = new User();
$u->setUserName($data['uName']);
$u->setPrepwd($data['pwd']);
$u->setPrepwd($data['pwd']);
if($u->isEqual()){
$val = $u->addUsers();
if($val)
$this->_helper->redirector('main','main');
}
else
$this->_helper->redirector('newuser','newuser');
}
}
?>
私の見解はnewuser.phtml
。のaction
属性に<form>
を指定しておりますNewuser/adduser
。しかし、フォームを送信すると、newuser.phtml
.
どうしてこれなの?
前もって感謝します
ちゃる