ZEND: Error: Class 'forms_ContactForm' not found (new to Zend)

Hello :slight_smile:

I am just starting Zend (my first project where Im trying to pull all the pieces together and make a test functional site) and have a MVC structure setup and bootstrapped successfully. I have Zend Layout working and have a simple layout going. I am now trying to take the Zend Form example from akrabat.com and incorporate it into my dev site.

I am getting this error:

Warning: include(forms\ContactForm.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\php\PEAR\Zend\Loader.php on line 83

Warning: include() [function.include]: Failed opening ‘forms\ContactForm.php’ for inclusion (include_path=‘.;.;C:\xampp\php\PEAR;…/library;…/application/classes/;…/application/models/’) in C:\xampp\php\PEAR\Zend\Loader.php on line 83

Fatal error: Class ‘forms_ContactForm’ not found in C:\xampp\htdocs\zendproject\application\controllers\ContactController.php on line 10

Here is my structure:

my index/bootstrap file

					. PATH_SEPARATOR . get_include_path()
					. PATH_SEPARATOR . '../library'
					. PATH_SEPARATOR . '../application/classes/'
					. PATH_SEPARATOR . '../application/models/'	

require_once 'Zend/Controller/Front.php';

$loader = Zend_Loader_Autoloader::getInstance();

$options = array(
	'layout' => 'layout',
	'layoutContent' => '../application/views/layouts/',
	'contentKey' => 'content'	);

new DbInitialize();

 * Setup controller
$controller = Zend_Controller_Front::getInstance();
$controller->throwExceptions(false); // should be turned on in development time 

// run!



class ContactController extends Zend_Controller_Action
    function indexAction()
        $this->view->pageTitle = "Zend_Form Example";
        $this->view->bodyCopy = "<p>Please fill out this form.</p>";

        $form = new forms_ContactForm();

        if ($this->_request->isPost()) {
            $formData = $this->_request->getPost();
            if ($form->isValid($formData)) {
                echo 'success';
            } else {

        $this->view->form = $form;



class forms_ContactForm extends Zend_Form 
    public function __construct($options = null) 
        $title = new Zend_Form_Element_Select('title');
              ->setMultiOptions(array('mr'=>'Mr', 'mrs'=>'Mrs'))
              ->setRequired(true)->addValidator('NotEmpty', true);
        $firstName = new Zend_Form_Element_Text('firstName');
        $firstName->setLabel('First name')

        $lastName = new Zend_Form_Element_Text('lastName');
        $lastName->setLabel('Last name')
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('Email address')
              ->addValidator('NotEmpty', true)
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Contact us');
        $this->addElements(array($title, $firstName, 
            $lastName, $email, $submit));


<h2><?php echo $this->pageTitle ;?></h2>
<?php echo $this->bodyCopy ;?>

<?php echo $this->form ;?>

I have also attached a zip file containing the site/structure (minus the library)

So as a test, I copied the entire class from ContactForm.php and pasted it into the same page as the controller ContactController.php and the page worked… I am completely new to this and am assuming that either a simple syntax naming error is causing the problem or I have to define somewhere in the code so it knows where to look to find the class??

How can I point my script to look for the ContactForm.php page so it can recognize my forms_ContactForm class?