I am rewriting existing pages with forms originally created under
Symfony 1.0.x so they can work under Symfony 1.2.4 without compat_10
mode activated (it is currently enabled). Once rewriting is complete,
I always get the following error after filling the form and submitting
it:
Undefined variable: form
Strangely, this error disappears after simply renaming the action as
well as the corresponding template page, indicating that my code is
indeed correct and that an issue exists, as I should not have to
rename an action for it to work.
Here is my code:
actions.class.php (this action generates and processes the form) :
public function executePhenoSourcesCreate($request) {
$this->form = new PhenoSourcesForm();
if($request->isMethod('post')) {
$this->form->bind($request->getParameter('phenoSource'));
if($this->form->isValid()) {
$formValues = $this->form->getValues();
...
phenoSourcesCreateSuccess.php :
<form action="<?php echo url_for('phenoSources/phenoSourcesCreate') ?
>" method="POST">
<?php echo $form->renderGlobalErrors() ?>
...
When renaming phenoSourcesCreateSuccess.php to
phenoSourceCreateSuccess.php and renaming the action
phenoSourcesCreate to phenoSourceCreate, everything works as expected.
But it does not until this simple renaming is done.
I am using dev mode, I cleaned cache and removed all files in the
cache dir. Unless I am missing something obvious, I should be able to
make this work without renaming each action I want to update.
Any clue on what is going on?
Thanks, Frédéric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---