Skip to content

Ability to set route to full inside named configuration #17971

@mehov

Description

@mehov

Description

I have a named route defined in config/routes.php and available as Router::url(['_name'=>'Foo:Bar:Example']. It outputs a relative URL, e.g. /foo/bar/example. Now I want the URL to always be a full URL that includes the website domain name, but there doesn't seem to be a way to accomplish that inside RouteBuilder::connect(). I tried passing '_full' => true as well as 'full' => true into both $defaults and $options of my RouteBuilder::connect().

I checked https://api.cakephp.org/5.0/class-Cake.Routing.RouteBuilder.html#connect() and searched for the word full on that page, nothing.

I'm talking about the last argument to https://api.cakephp.org/5.0/class-Cake.Routing.Router.html#url(), also mentioned as _full under "* There are a few 'special' parameters that can change the final URL string that is generated*". Everything works if I just pass true as the last argument to each Router::url() call where I refer to my named route, but I hoped there is a way to have that done on the route configuration level.

CakePHP Version

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions