Iam facing a typical issue with a form submit using Zend framework. Basically I have written a simple code to login a user, but this came out of the blue.
The code to show the form is pretty standard
$loginform = new Application_Form_Login(); $loginform->setMethod('post'); $loginform->setAction('login'); $this->view->form = $loginform;
When I use my home page url as - http://localhost.ruin.com/public/
I get an exception
Page not found
Exception information:
Message: Invalid controller specified (login)
Stack trace:
#0 C:\domains\ruin\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\domains\ruin\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 C:\domains\ruin\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\domains\ruin\public\index.php(27): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'controller' => 'login',
'action' => 'index',
'module' => 'default',
'username' => 'fsdf',
'password' => 'fdsf',
'submit' => 'submit',
)
However if I use the base url as http://localhost.ruin.com/public/index/ , the same code works perfectly.
I also know that its due to the fact that in first url the zend router is messing up the index controller with login since its not able to append the login action to the default index controller.
Do you guys think this is by design of Zend Framework and I shall have to forcefully send my users to this url http://localhost.ruin.com/public/index/ whenever they hit the home page or is there a way I can make my code work with http://localhost.ruin.com/public/
Any suggestions?