phpzend-frameworkzend-controller-routerzend-config

Invalid controller specified (adminlogin)


Code for indexAction() in AdminLoginController is:

$form_object = new Application_Form_NewProfile();
$form_object->setAction('/adminlogin/index');
$form_object->setMethod('post');
$this->view->form = $form_object;
if($this->getRequest()->isPost())
{
 echo 'Inside event:';
 $login_data = $this->getRequest()->getPost();
 if($form_object->isValid($login_data))
 {
       $form_data = $form_object->getValues();

 }


}

In Application_Form_NewProfile I have made a form.and in index.phtml I have viewed that form using echo $this->form. When I run the project form appears but when i put the details in form elements such as textfields and then click on button then it says that InvalidController specified(adminlogin) as I have set action of the form in above indexAction() as $form_object->setAction('/adminlogin/index') but its not finding that controller Why??Plz help me out to resolve this issue.Thanks in advance


Solution

  • try this

    $form_object->setAction($this->view->baseUrl("/adminlogin/index"));