We don't write such code, typically, a form like create/edit submit to the save action.
The difference create/edit is done by checking the id parameter. Present ? Update ! Missing ? Create... If you are facing complexity in template, use a helper. Have a look at admin generated code, Alexandre 2009/12/2 Adrien Mogenet <[email protected]> > Basically generated forms look like : > > <form action="<?php echo url_for('mymodule/'.($form->getObject()- > >isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='. > $form->getObject()->getId() : '')) ?>" > > > BUT because I'm using routes, I would like to use route to define my > action="..." parameter. > > Can you share your experience with that issue ? How do you manage this > part ? > > Do you write sthg like : > > <?php if (is new): ?> > <?php url_for('@myroute_1') ?> > <?php else: ?> > <?php url_for('@myroute_2') ?> > <?php endif; ?> > > > ? > > -- > > 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]<symfony-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > > -- Alexandre Salomé -- [email protected] -- 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.
