I have a “forms” directory inside my application directory with custom form php files in there. In my application.ini the appnamespace is “Application”. The form name I’m trying to use is BetaSignup.php. The class is Application_Form_BetaSignup.
In my controller I try to do $form = new Application_Form_BetaSignup, and I get an error saying:
Fatal error: Class ‘Application_Form_BetaSignup’ not found.
Thoughts on how to fix?
You can use the typical
application/formsdirectory for your form classes if you name them appropriately using the configuredappnamespacedirective (default “Application”). Please note, the directory name is lowercase “forms”.For example, say you have a registration form “Registration”. Create the file at
application/forms/Registration.php(note the case sensitivity) containing the classThe resource autoloader will be able to find your form when you instantiate it in your controllers, eg