Skip to content

Support boolean parameters in Route condition #30366

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy