Skip to content

Commit 188fa85

Browse files
Doc CompiledUrlMatcherDumper instead of PhpMatcherDumper
1 parent ab90ff1 commit 188fa85

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

create_framework/routing.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ generate absolute URLs::
217217
highly optimized URL matcher class that can replace the default
218218
``UrlMatcher``::
219219

220-
$dumper = new Routing\Matcher\Dumper\PhpMatcherDumper($routes);
220+
use Symfony\Component\Routing\Matcher\CompiledUrlMatcher;
221+
use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper;
221222

222-
echo $dumper->dump();
223+
// $compiledRoutes is a plain PHP array that describes
224+
// all routes using a performant data format
225+
$compiledRoutes = (new CompiledUrlMatcherDumper($routes))->getCompiledRoutes();
226+
227+
$matcher = new CompiledUrlMatcher($compiledRoutes, $context);

0 commit comments

Comments
 (0)