| First example in Forms Book. Error autoloading ContactForm class [message #60140] |
Thu, 04 September 2008 10:24  |
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   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Welcome to the fora.
Try clearing your cache?
Remember Palestine
|
|
|
|
| Re: First example in Forms Book. Error autoloading ContactForm class [message #60151 is a reply to message #60140 ] |
Thu, 04 September 2008 12:16   |
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
|
|
|
|
| Re: First example in Forms Book. Error autoloading ContactForm class [message #65952 is a reply to message #60140 ] |
Tue, 25 November 2008 12:57   |
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...
|
|
|
|