Thanks to visit codestin.com
Credit goes to github.com

Skip to content

generateUrl drops http scheme #16991

Closed
Closed
@jonathanbull

Description

@jonathanbull

The documentation implies that passing true as the third parameter to generateUrl will generate an absolute URL, including the scheme. This works as expected for a https URL, but in the case of a http URL, the scheme gets dropped. As a workaround I'm passing a 0 as the third argument:

foo_route:
    path:  /foo
    defaults: { _controller: FooBundle:Bar:index }
    schemes: [http] 

// Returns: //mydomain.com/foo
$this->generateUrl('foo_route', [], true);

// Returns: http://mydomain.com/foo
$this->generateUrl('foo_route', [], 0);

Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions