I have started learning zend framework. I am using version 1.12. I am using modular approach. I have created one module called ‘admin’. Following the my structure of the site
application/
(...other directories)
modules/
admin/
controllers/
IndexController.php
forms/
Login.php
views/
scripts/
(...view scripts)
Bootstrap.php
In this module I have created one form called ‘login’ using zf tool. whose class is created like this.
class Admin_Form_Login extends Zend_Form
{
public function init()
{
}
}
now the problem comes when I called this form in my admin module’s index controller.
class Admin_IndexController extends Zend_Controller_Action {
public function indexAction()
{
$form = new Admin_Form_Login;
}
}
It gives me error like this.
Fatal error: Class 'Admin_Form_Login' not found in E:\xampp\htdocs\novo\application\modules\admin\controllers\IndexController.php on line 13.
I am not sure what I am doing wrong. anybody, please help me.
I think you can do th enext things:
1. Enable autoloading for module’s models:
in application.ini:
Check your module bootstrap. It should be:
class Admin_Bootstrap extends Zend_Application_Module_Bootstrap