Skip to content

[DX] Improve generation of absolute URLs #17413

@javiereguiluz

Description

@javiereguiluz

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)Routing

    Type

    No type

    Projects

    No projects

    Milestone

    No 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