Skip to content

Navigation Menu

Sign in
Appearance settings

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

[DX] Improve generation of absolute URLs #17413

Copy link
Copy link
Closed
@javiereguiluz

Description

@javiereguiluz
Issue body actions

Problem

In Symfony 2.x this is how you generate an absolute URL:

$this->get('router')->generate('route_name', $routeParams, true);

This is how you do the same in Symfony 3.x:

use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

$this->get('router')->generate('route_name', $routeParams, UrlGeneratorInterface::ABSOLUTE_URL);

To me, the new version looks infinitely worse than the old one.

Solution

I guess Symfony Core won't accept bringing back the boolean argument, so we could add a new generateUrl() method:

$this->get('router')->generateUrl('route_name', $routeParams);

Thoughts? Better ideas? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)Routing

    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.