I can't find much documentation on this subject other than https://www.drupal.org/node/2122201. This leads me to think that the subject is either much easier than I think, and doesn't have documentation because everybody knows it, or that there isn't much available.

I have been working with the last example on that page, but I can't figure out where {image_style} and {scheme} are coming from.

I need to create something pretty simple, where there's a path that links to a page that requests some data from an API. For example, if someone browses to mysite.com/example/johndoe, then the page requests data from example.com/users/johndoe and displays it. So, I need to also have access to the entry in the URL to forward it to the API with my module, not just routing a ton of pages with a certain URL pattern to a single page.

I've found plenty of documentation on static page routing, and I have understood that.

  • 1
    {image_style} and {scheme} are URL parameters that correspond to the Image Style entity and a string respectively. I do not understand why you would not want to have a single controller handle a dynamic route. That is exactly the situation you are describing you want to do - have the controller make an API request based on the route parameter, and then return a render array based on the results to display. The result is not that you get a "single page", but you get infinite page because you have a dynamic route. – mradcliffe Jun 20 '16 at 17:20
  • I think I may have messed up my description somewhere, this is all somewhat new to me. I do indeed want the controller to make an API request based on the route parameter. That is exactly what I want - am I using the wrong search terms ('dynamic routing') to look for documentation on this subject? – Alexander Hansen Jun 20 '16 at 17:23

They are route parameters. See here: https://www.drupal.org/node/2186285

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.