I have tried setting up a zend site with the following directory structure :
application
-configs
-forms
-modules
-admin
-default
-controllers
-IndexController.php
-forms
-Testform.php
-layouts
-modules
-views
Then in my IndexController.php I have the following
public function contactMeAction() {
$request = $this->getRequest();
$form = new Form_Testform();
if ($this->getRequest()->isPost()) {
if ($form->isValid($request->getPost())) {
//process stuff
return $this->_helper->redirector('index');
}
}
$this->view->form = $form;
}
in the file Testform.php I have
class Form_Testform extends Zend_Form { public function init() { ......etc
But i'm getting the following error :
Fatal error: Class 'Form_Testform' not found in /home/websites/test.local/public_html/prototype/application/modules/default/controllers/IndexController.php on line 22
Call Stack: 0.0004 325228 1. {main}() /home/websites/test.local/public_html/prototype/public/index.php:0 0.1742 5351472 2. Zend_Application->run() /home/websites/test.local/public_html/prototype/public/index.php:28 0.1742 5351472 3. Zend_Application_Bootstrap_Bootstrap->run() /opt/ZendFramework-1.10.7/library/Zend/Application.php:366 0.1745 5351708 4. Zend_Controller_Front->dispatch() /opt/ZendFramework-1.10.7/library/Zend/Application/Bootstrap/Bootstrap.php:97 0.1872 5707240 5. Zend_Controller_Dispatcher_Standard->dispatch() /opt/ZendFramework-1.10.7/library/Zend/Controller/Front.php:954 0.2026 6016200 6. Zend_Controller_Action->dispatch() /opt/ZendFramework-1.10.7/library/Zend/Controller/Dispatcher/Standard.php:295 0.2029 6020692 7. IndexController->contactMeAction() /opt/ZendFramework-1.10.7/library/Zend/Controller/Action.php:513
Where am I going wrong?