zendframework / zend-router

Standalone routing implementation for HTTP and console requests
BSD 3-Clause "New" or "Revised" License
32 stars 20 forks source link

Config option to set TreeRouteStack::baseUri #51

Open Erikvv opened 6 years ago

Erikvv commented 6 years ago

In every project I see people working around the Url ViewHelper not working in console context.

If there was a config option like below we could have one standardized way of solving this.

<?php // config/autoload/server-url.local.php

return [
    'server_url' => 'https://example.com'
]

Example of my latest workaround: https://stackoverflow.com/a/52248041/1899162

Secondarily we could then also use this option to make the ServerUrl ViewHelper work in console context.

@weierophinney do you want this PR for this repository or for Zend\View?

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-router; a new issue has been opened at https://github.com/laminas/laminas-router/issues/3.