Skip to content

Commit

Permalink
Merge pull request FriendsOfSymfony#2853 from axzx/master
Browse files Browse the repository at this point in the history
New rounting files for Symfonyf4.1
  • Loading branch information
XWB authored Sep 19, 2018
2 parents 7cedff0 + 7a9408f commit f328299
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Resources/config/routing_41/all.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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">

<import
resource="@FOSUserBundle/Resources/config/routing_41/security.xml" />
<import
resource="@FOSUserBundle/Resources/config/routing_41/profile.xml"
prefix="/profile" />
<import
resource="@FOSUserBundle/Resources/config/routing_41/registration.xml"
prefix="/register" />
<import
resource="@FOSUserBundle/Resources/config/routing_41/resetting.xml"
prefix="/resetting" />
<import
resource="@FOSUserBundle/Resources/config/routing_41/change_password.xml"
prefix="/profile" />
</routes>
11 changes: 11 additions & 0 deletions Resources/config/routing_41/change_password.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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_change_password" path="/change-password" methods="GET POST">
<default key="_controller">fos_user.change_password.controller::changePasswordAction</default>
</route>

</routes>
27 changes: 27 additions & 0 deletions Resources/config/routing_41/group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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_group_list" path="/list" methods="GET">
<default key="_controller">fos_user.group.controller::listAction</default>
</route>

<route id="fos_user_group_new" path="/new" methods="GET POST">
<default key="_controller">fos_user.group.controller::newAction</default>
</route>

<route id="fos_user_group_show" path="/{groupName}" methods="GET">
<default key="_controller">fos_user.group.controller::showAction</default>
</route>

<route id="fos_user_group_edit" path="/{groupName}/edit" methods="GET POST">
<default key="_controller">fos_user.group.controller::editAction</default>
</route>

<route id="fos_user_group_delete" path="/{groupName}/delete" methods="GET">
<default key="_controller">fos_user.group.controller::deleteAction</default>
</route>

</routes>
15 changes: 15 additions & 0 deletions Resources/config/routing_41/profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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_profile_show" path="/" methods="GET">
<default key="_controller">fos_user.profile.controller::showAction</default>
</route>

<route id="fos_user_profile_edit" path="/edit" methods="GET POST">
<default key="_controller">fos_user.profile.controller::editAction</default>
</route>

</routes>
23 changes: 23 additions & 0 deletions Resources/config/routing_41/registration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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" path="/" methods="GET POST">
<default key="_controller">fos_user.registration.controller::registerAction</default>
</route>

<route id="fos_user_registration_check_email" path="/check-email" methods="GET">
<default key="_controller">fos_user.registration.controller::checkEmailAction</default>
</route>

<route id="fos_user_registration_confirm" path="/confirm/{token}" methods="GET">
<default key="_controller">fos_user.registration.controller::confirmAction</default>
</route>

<route id="fos_user_registration_confirmed" path="/confirmed" methods="GET">
<default key="_controller">fos_user.registration.controller::confirmedAction</default>
</route>

</routes>
23 changes: 23 additions & 0 deletions Resources/config/routing_41/resetting.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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_resetting_request" path="/request" methods="GET">
<default key="_controller">fos_user.resetting.controller::requestAction</default>
</route>

<route id="fos_user_resetting_send_email" path="/send-email" methods="POST">
<default key="_controller">fos_user.resetting.controller::sendEmailAction</default>
</route>

<route id="fos_user_resetting_check_email" path="/check-email" methods="GET">
<default key="_controller">fos_user.resetting.controller::checkEmailAction</default>
</route>

<route id="fos_user_resetting_reset" path="/reset/{token}" methods="GET POST">
<default key="_controller">fos_user.resetting.controller::resetAction</default>
</route>

</routes>
19 changes: 19 additions & 0 deletions Resources/config/routing_41/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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_security_login" path="/login" methods="GET POST">
<default key="_controller">fos_user.security.controller::loginAction</default>
</route>

<route id="fos_user_security_check" path="/login_check" methods="POST">
<default key="_controller">fos_user.security.controller::checkAction</default>
</route>

<route id="fos_user_security_logout" path="/logout" methods="GET POST">
<default key="_controller">fos_user.security.controller::logoutAction</default>
</route>

</routes>
2 changes: 2 additions & 0 deletions Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ import the FOSUserBundle routing files.
By importing the routing files you will have ready made pages for things such as
logging in, creating users, etc.

Use `routing_41` instead of `rounting` for `Symfony4.1`.

.. configuration-block::

.. code-block:: yaml
Expand Down
3 changes: 3 additions & 0 deletions Resources/doc/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ Advanced routing configuration

By default, the routing file ``@FOSUserBundle/Resources/config/routing/all.xml`` imports
all the routing files (except groups) and enables all the routes.
Use ``@FOSUserBundle/Resources/config/routing_41/all.xml`` for `Symfony4.1`.
In the case you want to enable or disable the different available routes, just use the
single routing configuration files.

Use `routing_41` instead of `routing` for `Symfony4.1`.

.. configuration-block::

.. code-block:: yaml
Expand Down

0 comments on commit f328299

Please sign in to comment.