I am using symfony 1.4, and I have a form with some POST params that have dots ('.') in them. These are being translated to underscores '_' before reaching the action code. To alleviate this, I have made the following route:
configure_submit:
url: /configure/submitconfig
options: { segment_separators: ['/'] }
params: { module: configure, action: submitconfig }
And it seems to be triggered by the code, because the logs indicate:
Feb 17 14:55:52开发者_Go百科 symfony [info] {sfPatternRouting} Match route "configure_submit" (/configure/submitconfig) for /configure/submitconfig with parameters array ( 'module' => 'configure', 'action' => 'submitconfig',)
However, the parameter comes through without periods anyway.
What can I do about the route so that the segment_separators option is applied?
You can set up the segment separators on factories.yml
all:
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
segment_separators: [/,-,.]
The segment_separators
parameter configures route segment separators, so you can have urls like /:param1.:param2
. It has nothing to do with post parameters, or anything besides routing.
精彩评论