Skip to content

Commit 8bbe446

Browse files
committed
Fix setParameter for RouteCollection in Create Framework tutorial
1 parent 8b20cc8 commit 8bbe446

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

create_framework/dependency_injection.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,16 @@ object::
227227
$container->setParameter('charset', 'UTF-8');
228228

229229
Instead of relying on the convention that the routes are defined by the
230-
``$routes`` variables, let's use a parameter again::
230+
``$routes`` variables, let's use a reference::
231231

232232
// ...
233233
$container->register('matcher', Routing\Matcher\UrlMatcher::class)
234-
->setArguments(['%routes%', new Reference('context')])
234+
->setArguments([new Reference('routes'), new Reference('context')])
235235
;
236236

237237
And the related change in the front controller::
238238

239-
$container->setParameter('routes', include __DIR__.'/../src/app.php');
239+
$container->set('routes', $routes);
240240

241241
We have barely scratched the surface of what you can do with the
242242
container: from class names as parameters, to overriding existing object

0 commit comments

Comments
 (0)