Skip to content

Support boolean parameters in Route condition #30366

Closed
@quazardous

Description

@quazardous

Description

Using parameter substitution with boolean is not allowed in route condition.

Example

So this is not possible:

/**
 * @Route("/test", condition="%kernel.debug%")
 */
class TestController extends AbstractController
{*
...

Exception is here :

// symfony/framework-bundle/Routing/Router.php
// near line 176 : hard coded type test : add is_bool() ?
...

            if (\is_string($resolved) || is_numeric($resolved)) {
                $this->collectedParameters[$match[1]] = $resolved;

                return (string) $resolved;
            }
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions