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 6151769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:48:55+00:00 2026-05-23T19:48:55+00:00

I’m aware that my question is very…plain and simple, but I’ll ask it anyway:

  • 0

I’m aware that my question is very…plain and simple, but I’ll ask it anyway: hope that someone can give me a hint.

I’m rewriting a PHP web-application using Symfony2. My need is to perform CRUD operations on database objects (which have a primary key and other two fields, called field1 and field2)

In my old web-app I used to recall this URL:

  http://myhost/updateProduct.php?id=foo&field1=value1&field2=value2

to invoke the updateProduct.php script to update the object having id=foo, setting value1 for field1 and value2 for field2.

Now I’m willing to use a Symfony2 controller to do that job…I wonder which routing should I set up for that. My controller is ProductController and it embeds a updateAction($id,$field1,$field2) method.

I tried with something like (yml syntax):

myBundle_update:
    pattern:  /product/update/{id}/field1={value1}&field2={value2}
    defaults: { _controller: TestMyBundle:Product:update } 

but it’s not working.

So my question is: I’m mistaking the routing syntax (and if so, which is the correct one)? Or is there something I am missing about how to properly split request parameters to controllers?

Thanks in advance

  • 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-05-23T19:48:55+00:00Added an answer on May 23, 2026 at 7:48 pm

    You probably want your route to look something like this:

    pattern:    /product/update/{id}/{value1}/{value2}
    

    This way just just invoke /product/update/1/fieldValue1/fieldValue2 to update the product.

    I’m not sure, but probably the routing has some problems with your route defining an & in its route.

    Update:
    Ah, the problem lies most probably in the fact that you don’t have a / between your two values.
    Symfony2 uses the regex [^/]+ as standard regex for a parameter.

    http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.