Skip to content

Need a fully qualified urlFor() helper #1326

Description

@akrabat

In the current Slim 3, to create a fully qualified URL for a given route name, you need to do this inside a route callable:

$router = $this->router;
$uri = $request->getUri();

$url = $uri->getScheme() . '://' . $uri->getHost()
        . $uri->getPort() ? ':' . $uri->getPort() : ''
        . rtrim($uri->getBasePath(), '/')
        . $router->pathFor('news-archive', ['year'=>'2015'], ['foo' => 'bar']);

We need a helper method for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions