This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » First example in Forms Book. Error autoloading ContactForm class
First example in Forms Book. Error autoloading ContactForm class [message #60140] Thu, 04 September 2008 10:24 Go to next message
Ser5 [ru]  is currently offline Ser5 [ru]
Messages: 3
Registered: September 2008
Junior Member
I'm trying to start learning symfony forms.
Now I'm here: http://www.symfony-project.org/book/forms/1_1/en/01-Form-Cre ation

I'm running symfony 1.1.1 on WinXP SP2, Apache 2.2.

My project resides in
D:\PP\PHP\symfony\test\

I've put ContactForm in
D:\PP\PHP\symfony\test\apps\main\lib\form\ContactForm.class. php
file

then generated "contact" module by using
"php symfony generate:module main contact"

and put this
  public function executeIndex($request)
  {
    $this->form = new ContactForm();
  }

into D:\PP\PHP\symfony\test\apps\main\modules\contact\actions\act ions.class.php

When a try to launch main_dev.php/contact
I see an error:
Quote:

Fatal error: Class 'ContactForm' not found in D:\PP\PHP\symfony\test\apps\main\modules\contact\actions\act ions.class.php on line 20


So, what should I do?

[Updated on: Thu, 04 September 2008 10:26]

Re: First example in Forms Book. Error autoloading ContactForm class [message #60149 is a reply to message #60140 ] Thu, 04 September 2008 11:43 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Welcome to the fora.

Try clearing your cache?


Remember Palestine
icon14.gif  Re: First example in Forms Book. Error autoloading ContactForm class [message #60150 is a reply to message #60149 ] Thu, 04 September 2008 11:57 Go to previous messageGo to next message
Ser5 [ru]  is currently offline Ser5 [ru]
Messages: 3
Registered: September 2008
Junior Member
Oh, thank you, that works! Smile
But I thought that main_dev.php never uses cache... and there is no a word in the Forms Book's example about clearing the cache...
Re: First example in Forms Book. Error autoloading ContactForm class [message #60151 is a reply to message #60140 ] Thu, 04 September 2008 12:16 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I think there are some things that are always cached - the existence of classes is the main one. It would be just too slow, even in a dev front controller, to scan all your lib folders for class files.


Remember Palestine
icon14.gif  Re: First example in Forms Book. Error autoloading ContactForm class [message #60166 is a reply to message #60151 ] Thu, 04 September 2008 13:36 Go to previous messageGo to next message
Ser5 [ru]  is currently offline Ser5 [ru]
Messages: 3
Registered: September 2008
Junior Member
Got the idea, thanks a lot for explanations. Smile
Re: First example in Forms Book. Error autoloading ContactForm class [message #65952 is a reply to message #60140 ] Tue, 25 November 2008 12:57 Go to previous messageGo to next message
cybercsen  is currently offline cybercsen
Messages: 7
Registered: August 2008
Junior Member
This could be a simple reason of


U have to enclose the class definitions by <?php ?> tag. It's enough.

For example,

Your ContactForm.class.php should be look like

<?php
       class ContactForm(){
         ..........
       }
?>


@
Each one bit makes the BYTE, KB, MB, GB, TB and so on..

So keep help...
Re: First example in Forms Book. Error autoloading ContactForm class [message #65971 is a reply to message #60140 ] Tue, 25 November 2008 16:57 Go to previous message
Seikilos  is currently offline Seikilos
Messages: 609
Registered: May 2008
Location: Germany
Faithful Member
cyberseen, i think he knows that Smile

Anyway, Ser5u, you should update your version to 1.1.6
Probably using svn would be a good start Smile


Debugging is all I doֻ (if these dots are not in line then your screen is broken)
Previous Topic:[SOLVED] sfWidgetFormI18nSelectCountry default value
Next Topic:propel:build-forms builds no forms with 2 databases
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software