I have made module Admin. In this module, in controller I have called form
class Admin_AdminController extends Zend_Controller_Action
{
public function indexAction()
{
//$form = new Application_Form_Login();
$form = new Admin_Form_Admin();
$this->view->form = $form;
}
}
But In controller its giving error -> Class ‘Admin_Form_Admin’ not found in application\modules\Admin\controllers\AdminController.php
My forms is in application\modules\Admin\forms\Admin.php.Below is my form code
class Admin_Form_Admin extends Zend_Form
{
public function init()
{
this->setMethod('post');
/* Form Elements & Other Definitions Here ... */
$user = $this ->CreateElement('text','username');
$password = $this->createElement('text','password');
$login = $this->createElement('submit','button');
$this->addElements(array($user,
$password,
$login
));
}
}
Three things are required here…
You need to bootstrap the modules resource
You need to set the modules directory in your front controller
You need a bootstrap class in your admin module
With these three things in place, your code should work as-is.