Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #26284 [Routing] allow no-slash root on imported routes (nico…
…las-grekas) This PR was merged into the 4.1-dev branch. Discussion ---------- [Routing] allow no-slash root on imported routes | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12141 | License | MIT | Doc PR | - With this change, a collection is imported, its root can have no slash appended. e.g.: ```yaml import: resource: ... trailing_slash_on_root: false ``` Works also for XML and PHP-DSL. Commits ------- 5a98515 [Routing] allow no-slash root on imported routes
- Loading branch information
Showing
12 changed files
with
109 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/import_with_no_trailing_slash/routing.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?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="../controller/routing.xml" prefix="/slash" name-prefix="a_" /> | ||
<import resource="../controller/routing.xml" prefix="/no-slash" name-prefix="b_" trailing-slash-on-root="false" /> | ||
|
||
</routes> |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/import_with_no_trailing_slash/routing.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
app: | ||
resource: ../controller/routing.yml | ||
name_prefix: a_ | ||
prefix: /slash | ||
|
||
api: | ||
resource: ../controller/routing.yml | ||
name_prefix: b_ | ||
prefix: /no-slash | ||
trailing_slash_on_root: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/php_dsl_sub_root.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Routing\Loader\Configurator; | ||
|
||
return function (RoutingConfigurator $routes) { | ||
$add = $routes->collection('r_'); | ||
|
||
$add('root', '/'); | ||
$add('bar', '/bar/'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters