You don't have application in your path, so of course it won't see
forms/ContactForm.php

Better than putting it in your path though, I'd just use the resource
autoloader:
http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html

That way all you need in your path is:

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(dirname(__FILE__).'/../library'),
    get_include_path()
)));

It might also be a good idea to create an APPLICATION_PATH and/or
APPLICATION_ROOT contants.

eg:

defined('APPLICATION_ROOT')
    || define('APPLICATION_ROOT',
            realpath(dirname(__FILE__).'/..'));

// Define path to application directory
defined('APPLICATION_PATH')
        || define('APPLICATION_PATH',
                APPLICATION_ROOT . '/application');

That way, you could set the library path using:
APPLICATION_ROOT . '/library'

And setting up the paths in for your front controller would look like:

$controller->setControllerDirectory(APPLICATION_PATH. '/controllers');

The benefit is that the you end up with an absolute filesystem path which
can be cached.

Cheers,
David
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Error-Class-forms-ContactForm-not-found-new-to-Zend-tp3319850p3320418.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to