php - Symfony Routing: sf_format default value

847

Having the following route:

  blog_rss_comments:
    url:     /blog/feeds/:type/comments.:sf_format
    param: {module: blog, action: feedComments }
    requirements: { sf_method: get, sf_format: (?:rss|xml|html) }

Is it possible to add a default-sf_format setting, so I do not have to pass sf_format every time?

991

Answer

Solution:

param is where you can put default values.

 param: {module: blog, action: feedComments, sf_format: html }

People are also looking for solutions to the problem: php - Better to store phone in three fields or as one?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.