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 » support » symfony 1.3 and 1.4 » sfForm::renderFormTag() problem
sfForm::renderFormTag() problem [message #103064] Sun, 25 July 2010 23:21 Go to next message
TimB  is currently offline TimB
Messages: 14
Registered: June 2010
Location: Düsseldorf, Germany
Junior Member
Hey guys,

got a little problem with renderFormTag() method of sfForm class. I've got the following in my template:

<?php echo $form->renderFormTag('community/register') ?>


This is created:

<form action="community/register" method="post">


Problem: Now when I submit the form I get to:

Quote:


http://csmtools.localhost/csmtools_dev.php/community/community/register



What could be the problem?

Best regards,
Tim
Re: sfForm::renderFormTag() problem [message #103095 is a reply to message #103064 ] Mon, 26 July 2010 16:22 Go to previous messageGo to next message
claudia_k  is currently offline claudia_k
Messages: 29
Registered: June 2010
Junior Member
The first parameter for sfFormObject::renderFormTag is an Url, not a route. So better use (note the call to url_for):

<?php echo $form->renderFormTag(url_for('community/register')) ?>


See also the tip below the code here: http://www.symfony-project.org/forms/1_4/en/03-Forms-for-web -Designers#chapter_03_the_prototype_template


To speed up routing it would be even better to use something like:
<?php echo $form->renderFormTag(url_for('@register')) ?>


Claudia

[Updated on: Mon, 26 July 2010 16:23]


http://www.knewledge.com
Re: sfForm::renderFormTag() problem [message #103110 is a reply to message #103064 ] Mon, 26 July 2010 23:02 Go to previous message
TimB  is currently offline TimB
Messages: 14
Registered: June 2010
Location: Düsseldorf, Germany
Junior Member
Thank you! I have just been referring to http://www.symfony-project.org/gentle-introduction/1_4/en/10 -Forms#chapter_10_displaying_a_form, url_for() is not used there Smile
Previous Topic:Validate/save an embedded form based on a value in the parent form
Next Topic:Twig and Symfony 1.4
Goto Forum:
  

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