php - how to change route pattern in symfony2 -
in 1 of symfony2 bundle have next file called registration.xml:
<?xml version="1.0" encoding="utf-8" ?> <routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> <route id="fos_user_registration_register" pattern=""> <default key="_controller">fosuserbundle:registration:register</default> </route> </routes> and here's current routing.yml:
fos_user_register: resource: "@fosuserbundle/resources/config/routing/registration.xml" prefix: /register the issue here when seek print route seeing:
fos_user_registration_register /register/ how remove trailing slash @ end of /register/ ? wanted /register
i not used routing in xml don't have utilize path= instead pattern= ? , if doesn't solve seek this:
yml
fos_user_register: resource: "@fosuserbundle/resources/config/routing/registration.xml" prefix: / xml
<routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> <route id="fos_user_registration_register" path="register"> <default key="_controller">fosuserbundle:registration:register</default> </route> </routes> or perhaps path="/register" instead of path="register"
anyhow should utilize same format everywhere if can.
php symfony2
No comments:
Post a Comment