Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incorrect Usage of setParameter for RouterCollection in "Create Framework" Tutorial #20823

Copy link
Copy link
Closed
@techware01

Description

@techware01
Issue body actions

I am following the "Create Framework" tutorial, specifically the section on "The DependencyInjection Component." I encountered an issue with the following line of code:

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

This line attempts to set a RouterCollection as a parameter, which results in an error:

PHP Fatal error:  Uncaught TypeError: Symfony\Component\DependencyInjection\Container::setParameter(): Argument #2 ($value) must be of type UnitEnum|array|string|int|float|bool|null, Symfony\Component\Routing\RouteCollection given, called in /web/front.php

In my understanding as such this method of using routes in the DI container is not possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RoutinghasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.