I'm perplexed by this. I have a login action that looks like this:
public function loginAction()
{
$form = new Application_Form_Login;
$form->setAction("/users/login");
$request = $this->getRequest();
var_dump($request->isPost());
if ($request->isPost() && $form->isValid($request->getPost())) {
// snipped code that is never reached anyway
}
$this->view->form = $form;
}
And a form:
class Application_Form_Login extends Zend_Form
{
public function init()
{
$this->setMethod("post");
$email = new Zend_Form_Element_Text("email");
$email->addFilter("StringTrim")
->addValidator("NotEmpty")
->addValidator("EmailAddress")
->setRequired(true)
->setLabel("Email address");
$this->addElement($email);
$password = new Zend_Form_Element_Password("password");
$password->addFilter("StringTrim")
->addValidator("NotEmpty")
->setRequired(true)
->setLabel("Password");
$this->addElement($password);
$submit = new Zend_Form_Element_Submit("finish");
$submit->setLabel("Login");
$this->addElement($submit);
}
}
var_dump($request->isPost())
always returns false, yet in a mostly identical action it works perfectly! Any ideas?