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 » How to create a new form
How to create a new form [message #102625] Fri, 16 July 2010 17:35 Go to next message
jstuardo  is currently offline jstuardo
Messages: 49
Registered: May 2010
Location: Santiago
Member
Hello...

I have created a new action called changePassword. I have a new route that is :module/:id/changePassword and it works correctly.

I have this in the executeChangePassword method:

public function executeChangePassword(sfWebRequest $request) 
{
    	$this->user = $this->getRoute()->getObject();
    	$this->form = $this->configuration->getForm($this->user);
}


I copied the editSuccess.php template into a changePasswordSuccess.php template and when I run the page, the edit form appears.

Now I modified the generator.yml in order to show only the password field, but when I add the changePassword action, a parsing error occurs.

How can I do it? is there a way to create a new form in order to be processed the same way as the other standard forms?

Thanks
Jaime


Symfony 1.4
Re: How to create a new form [message #102626 is a reply to message #102625 ] Fri, 16 July 2010 18:28 Go to previous messageGo to next message
sescandell  is currently offline sescandell
Messages: 65
Registered: December 2008
Location: France
Member
Hi,

I imagine you are using auto-generation from Symfony ?
(in fact I don't really understand what you are doing in your action ...)

But, because it is a Parsing error, it would be useful to see the file concerning by the error ...
Please, post it in order to help you (and which line has an error of parsing ?)
Re: How to create a new form [message #102627 is a reply to message #102626 ] Fri, 16 July 2010 19:09 Go to previous message
jstuardo  is currently offline jstuardo
Messages: 49
Registered: May 2010
Location: Santiago
Member
The parsing error was in generator.yml file.

I added this in it:

  changePassword:
    fields:
      password: { label: Contraseña, attributes: { size: 25, maxlength: 20, rel: password, class: req-string req-same }, help: Contraseña del usuario (requerido). }
      repeat_password: { label: Repita Contraseña, attributes: { size: 25, maxlength: 20, rel: password, class: req-string req-same }, help: Repetición contraseña del usuario (requerido). }
    display:
      General: [ password, repeat_password ]


If I remove changePassword definition, it works well as always.

Thanks
Jaime

[Updated on: Fri, 16 July 2010 19:11]


Symfony 1.4
Previous Topic:Admin generator problem
Next Topic:XSS protection and output escaping/filtering
Goto Forum:
  

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