Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-22-2008, 10:13 AM
jap jap is offline
Junior Member
 
Join Date: Apr 2007
Posts: 23
Default Loading form class problem

Hi

I'm setting up and testing Zend Framework but I just can't find out why I can't get this file (class) loaded.

Zend_Loader::loadClass('forms_ContactForm');

Then I get this error:

exception 'Zend_Exception' with message 'File "forms/ContactForm.php" does not exist or class "forms_ContactForm" was not found in the file' in /home/devtech/public_html/zspot/library/Zend/Loader.php:88
(and the stack...)

The actual file is located at: /application/default/forms/ContactForm.php name of the class is forms_ContactForm.

Is this enough information to maybe solve this problem?
Thanks,
Jasper
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-22-2008, 02:58 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

The problem is that your forms directory isn't in your include path. Two possible solutions would be to:
1. Add the forms directory to the include in the contollers init() function. The bad is that you have to do this for every controller, resulting in lots of repeated code.

2. Make a plugin to add the forms directory. This is probably the better solution. You can find an example with model loading here. Some minor alterations will get you up and going.
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:11 AM.