Jump to content

Recommended Posts

  • 6 months later...
Posted

In recent PW3 versions you can prepend "http" and get absolute urls like this:

$config->urls->httpTemplates

 

  • Like 10
  • 5 months later...
Posted
On 12/20/2016 at 2:35 AM, tpr said:

In recent PW3 versions you can prepend "http" and get absolute urls like this:


$config->urls->httpTemplates

 

Works!.. Where you learn this??

  • 2 years later...
Posted

Am I the only one often needing a httpsUrl instead of a httpurl?

https://github.com/processwire/processwire/pull/116/commits/25be5b54edc16edc80b337723145142660f795c6

Maybe it would make sense to have not only $config->url() and $config->path() but also $config->httpUrl() and $config->httpsUrl()

$config->url("/var/www/foo/bar/site/templates/style.css"); // /site/templates/style.css
$config->path("/site/templates/style.css"); // /var/www/foo/bar/site/templates/style.css
$config->httpUrl("/site/templates/style.css"); // http://www.foo.bar/site/templates/style.css
$config->httpsUrl("/site/templates/style.css"); // https://www.foo.bar/site/templates/style.css
$config->httpsUrl($pages->get(2)); // https://www.foo.bar/processwire/

What do you think? You can support my request here: https://github.com/processwire/processwire-requests/issues/326

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...