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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:43:01+00:00 2026-06-12T02:43:01+00:00

This seems like the dumbest question ever, but I can’t seem to figure it

  • 0

This seems like the dumbest question ever, but I can’t seem to figure it out. I have a page the needs to redirect to a complex route and I can’t seem to generate the URL. Redirecting to a simple route is easy enough:

return $this->redirect($this->generateUrl('testnumber'));

However, I want to route to: testnumber/1/question/4. How can I accomplish this incredibly simple task? The only thing I have found in the documentation and Google allows me to add parameters and not just create a complex route. For example:

generateURL('testnumber', array('testid'=>1, 'question'=>4))

makes a URL of /testnumber?testid=1&question=4, which I do not want.

Edit: Yes, I already have the route created in a YML file. I simply cannot generate the URL to link to it.

        return $this->redirect($this->generateUrl(???????????),true));

This is my route:

@Route("/testnumber/{testid}/question/{question}", name="testnumber")

The Symfony documentation only shows how to generate a URL to ” testnumber/1″, I need to generate “testnumber/1/question/4”.

  • 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-12T02:43:02+00:00Added an answer on June 12, 2026 at 2:43 am

    For

    generateURL('testnumber', array('testid'=>1, 'question'=>4))
    

    to work as you want, your route must look like (example using annotations)

    @Route("/testnumber/{testid}/question/{question}", name="testnumber")
    

    If you don’t define “testid” & “question” parameters in your route, they’ll be added to the query string (appended at the end of the URL as GET paramaters)

    generated_route?test_id=X&question=X
    

    Find here more relevent examples.

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

Sidebar

Related Questions

this seems like a basic question but I can't figure out the best implementation.
This seems like it should be obvious but I can't figure it out. Suppose
This seems like it should be simple, but I can't figure it out. I'm
This seems like it should have a simple solution but I can't seem to
This seems like a simple to answer question, but I cannot figure out how
This seems like a pretty simple question but I can't seem to get an
This seems like a really simple question but I can't seem to find information
This seems like the simplest Git question, but I can't find ANYTHING on it.
This seems like something simple but I can't seem to get it to work.
This seems like an elementary question, but I can't find the answer anywhere: I

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.