ajax - Symfony: How can I create user-templates from filled out forms -


in symfony project i'm trying provide "save template"-button embedded form. embedded form contains dynamic embedded forms itself.

example:

alt text

the user should able save template without saving whole form. i'm going use ajax achieve (as did, dynamic add-behavior).

the actual problem symfony names form in dependence on parent form, e.g.

<input name="project[workflow][1][name]" /> 

but template isn't related "project" @ all. on other hand, naming format required later, when saving whole form.

sending whole form server might solution, think it's bad practice / overkill / waste of bandwidth.

is there common way how this? if not, have basic approach in mind?

regards, uli

symfony sfforms take 2 arrays on bind method, don't need take them request.

since have several workflowforms there loop involved!

    $formdata = $request->getparameter('project'); // project['workflow'] except symfony 1.4      foreach ($formdata['workflow'] $embeddeddata)     {       $formfiles = $request->getfiles('project');       $embeddedfiles = $formfiles['workflow'];       $form = new workflowform();       $form->bind($embeddeddata, $embeddedfiles);        if ($form->isvalid())       {         // thing         // ...         $form->save();       }     } 

then process each form on // thing


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -