Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:29:15+00:00 2026-06-09T04:29:15+00:00

I have a page (let’s call it edit page) with two forms – the

  • 0

I have a page (let’s call it edit page) with two forms – the first one for updating information in one table in the database and it has a submit button “Save”, and the other is for perstitng information in another table and it has its own button “Add” and a link – “Delete” to delete the existing rows. Whatever of the three Save, Add or Delete you press you should stay at the same page. Could you please advice me which will be the best way to make things:

  1. When you press delete I’m routing to another url which calls deleteController in which body it redirects back to the previous page (edit page)

    I couldn’t come up with anything better because Delete is a link. Feel free to give your suggestions and please tell whether my way is very stupid or it’s acceptable.

  2. How to manage the two forms?

    1. At first I thought one controller to manage both forms but there is a problem – I don’t know how the controller can identify exactly which button was pressed (Save or Add) to do the proper thing. It can everytime update the two tables acting as the two buttons are pressed at the same, but I think that this would be unrational because most of the time only the one table will have changes.

    2. Another idea is to repeat the same with Delete – to have two different controllers which to do some actions (update and persist) and then to redirect to the edit page with which I aim the user to feel like never leaving the url of the beginning page (the edit page).

What is the best way to manage this tasks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:29:17+00:00Added an answer on June 9, 2026 at 4:29 am

    SensioGeneratorBundle can generate CRUD forms and controllers. It ships within Symfony Standard edition. You should look at it. Generated code is easily customizable and is well engineered.


    1. You have done the right choice. You could also put the delete button into a form with method="delete" and do something like this into your controller:

      /**
       * @Route("/{id}")
       * @Method("DELETE")
       * @ParamConverter("entity", class="MyAdminBundle:MyEntity")
       */
      public function deleteAction(MyEntity $entity)
      {
          // Do deletion
          // ...
      
          // Do redirection
          $this->redirect($this->generateUrl('list'));
      }
      
    2. You could set different method (edition: POST, creation: PUT).
      You could set different action and then do a redirection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a page with outputcaching (let's call it Employees.aspx) which accepts one
I have two websites: http://example.com http://example.com/sub I have a page, let's say: http://example.com/sub/page1 Is
Let's say we have two flash objects on the same html page. I want
First let me explain. I have several addresses on the page that I put
I have an application that has a certain page -- let's call it Page
I have a page with URL that is dynamic. Let's call it view post
I have this page, let's call it index.php index.php has a list of users
I have an html page (let's call parent) with a link that opens another
I have a jsp page -- let's call it index.jsp. The user clicks on
let say i have a page , and i want to allow 3rd party

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.