0
votes

I am new to Zend Framework. I am using modules for front end and admin panel.

In the admin panel, I would like to have login form, then the folder structure is

application/

         modules/
                 backend/
                       controllers/
                             LoginController.php
                       forms/
                             LoginForm.php
                       views/
                             scripts/
                                     login/
                                           index.phtml

I am having an error "Fatal error: Class 'Backend_Forms_LoginForm' not found in D:\wamp\www\ioc\Application\modules\backend\controllers\LoginController.php on line 9"

Please help me to fix this.

Thanks.

I created controller and forms using following URL http://weierophinney.net/matthew/archives/165-Login-and-Authentication-with-Zend-Framework.html

In the controller, it call the form by

return new Backend_Forms_LoginForm(array( 'action' => '/login/process', 'method' => 'post', ));

Please help me to fix this.

2

2 Answers

1
votes

If you're using standard autoloading, your form's class should be named exactly Backend_Form_LoginForm ('form' in singular).

Also make sure that you have a bootstrap for Backend module in place.

-1
votes

I don't know why it won't work... it sould... by the way, a lot of developers that I met use to put all the forms into the default form directory or into the Library directory, so the can change the name as they prefer without doing includes or something else.

in your case you can try create /library/backend/forms and write the form in the same way as you writed