-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #30508 [Routing] Exposed "utf8" option, defaults "locale" and…
… "format" in configuration (Jules Pietri) This PR was merged into the 4.3-dev branch. Discussion ---------- [Routing] Exposed "utf8" option, defaults "locale" and "format" in configuration | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | symfony/symfony-docs#11126 A sibling to #30501, everything is in the title :). Commits ------- 2911490 [Routing] Exposed "utf8" option, defaults "locale" and "format" in configuration
- Loading branch information
Showing
30 changed files
with
529 additions
and
13 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
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
34 changes: 34 additions & 0 deletions
34
src/Symfony/Component/Routing/Tests/Fixtures/AnnotationFixtures/GlobalDefaultsClass.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,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
/** | ||
* @Route("/defaults", locale="g_locale", format="g_format") | ||
*/ | ||
class GlobalDefaultsClass | ||
{ | ||
/** | ||
* @Route("/specific-locale", name="specific_locale", locale="s_locale") | ||
*/ | ||
public function locale() | ||
{ | ||
} | ||
|
||
/** | ||
* @Route("/specific-format", name="specific_format", format="s_format") | ||
*/ | ||
public function format() | ||
{ | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Symfony/Component/Routing/Tests/Fixtures/AnnotationFixtures/Utf8ActionControllers.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,25 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures; | ||
|
||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
/** | ||
* @Route("/test", utf8=true) | ||
*/ | ||
class Utf8ActionControllers | ||
{ | ||
/** | ||
* @Route(name="one") | ||
*/ | ||
public function one() | ||
{ | ||
} | ||
|
||
/** | ||
* @Route(name="two", utf8=false) | ||
*/ | ||
public function two() | ||
{ | ||
} | ||
} |
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) { | ||
$routes->add('defaults', '/defaults') | ||
->locale('en') | ||
->format('html') | ||
; | ||
}; |
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,8 @@ | ||
<?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 | ||
https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="defaults" path="/defaults" locale="en" format="html" /> | ||
</routes> |
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,4 @@ | ||
defaults: | ||
path: /defaults | ||
locale: en | ||
format: html |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/imported-with-defaults.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) { | ||
$routes | ||
->add('one', '/one') | ||
->add('two', '/two')->defaults(['specific' => 'imported']) | ||
; | ||
}; |
11 changes: 11 additions & 0 deletions
11
src/Symfony/Component/Routing/Tests/Fixtures/imported-with-defaults.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,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 | ||
https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="one" path="/one" /> | ||
<route id="two" path="/two"> | ||
<default key="specific">imported</default> | ||
</route> | ||
</routes> |
7 changes: 7 additions & 0 deletions
7
src/Symfony/Component/Routing/Tests/Fixtures/imported-with-defaults.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,7 @@ | ||
one: | ||
path: /one | ||
|
||
two: | ||
path: /two | ||
defaults: | ||
specific: imported |
11 changes: 11 additions & 0 deletions
11
src/Symfony/Component/Routing/Tests/Fixtures/importer-with-defaults.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,11 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Routing\Loader\Configurator; | ||
|
||
return function (RoutingConfigurator $routes) { | ||
$routes->import('imported-with-defaults.php') | ||
->prefix('/defaults') | ||
->locale('g_locale') | ||
->format('g_format') | ||
; | ||
}; |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/importer-with-defaults.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 | ||
https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<import resource="imported-with-defaults.xml" prefix="/defaults" | ||
locale="g_locale" | ||
format="g_format" /> | ||
</routes> |
5 changes: 5 additions & 0 deletions
5
src/Symfony/Component/Routing/Tests/Fixtures/importer-with-defaults.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,5 @@ | ||
defaults: | ||
resource: imported-with-defaults.yml | ||
prefix: /defaults | ||
locale: g_locale | ||
format: g_format |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/localized/imported-with-utf8.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) { | ||
$routes | ||
->add('utf8_one', '/one') | ||
->add('utf8_two', '/two') | ||
; | ||
}; |
8 changes: 8 additions & 0 deletions
8
src/Symfony/Component/Routing/Tests/Fixtures/localized/imported-with-utf8.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,8 @@ | ||
<?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"> | ||
|
||
<route id="utf8_one" path="/one" /> | ||
<route id="utf8_two" path="/two" /> | ||
</routes> |
5 changes: 5 additions & 0 deletions
5
src/Symfony/Component/Routing/Tests/Fixtures/localized/imported-with-utf8.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,5 @@ | ||
utf8_one: | ||
path: /one | ||
|
||
utf8_two: | ||
path: /two |
7 changes: 7 additions & 0 deletions
7
src/Symfony/Component/Routing/Tests/Fixtures/localized/importer-with-utf8.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,7 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Routing\Loader\Configurator; | ||
|
||
return function (RoutingConfigurator $routes) { | ||
$routes->import('imported-with-utf8.php')->utf8(); | ||
}; |
7 changes: 7 additions & 0 deletions
7
src/Symfony/Component/Routing/Tests/Fixtures/localized/importer-with-utf8.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,7 @@ | ||
<?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 | ||
https://symfony.com/schema/routing/routing-1.0.xsd"> | ||
<import resource="imported-with-utf8.xml" utf8="true" /> | ||
</routes> |
3 changes: 3 additions & 0 deletions
3
src/Symfony/Component/Routing/Tests/Fixtures/localized/importer-with-utf8.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,3 @@ | ||
utf8_routes: | ||
resource: imported-with-utf8.yml | ||
utf8: true |
10 changes: 10 additions & 0 deletions
10
src/Symfony/Component/Routing/Tests/Fixtures/localized/utf8.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) { | ||
$routes | ||
->add('some_route', '/') | ||
->add('some_utf8_route', '/utf8')->utf8() | ||
; | ||
}; |
6 changes: 6 additions & 0 deletions
6
src/Symfony/Component/Routing/Tests/Fixtures/localized/utf8.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,6 @@ | ||
some_route: | ||
path: / | ||
|
||
some_utf8_route: | ||
path: /utf8 | ||
utf8: true |
Oops, something went wrong.