Jump to content

$config->urls->templates with absolute URL?


Recommended Posts

  • 6 months later...
  • 5 months later...
  • 2 years later...
On 5/30/2017 at 12:23 PM, tpr said:

From the weekly blog :)

The weekly blog had it here:
https://processwire.com/blog/posts/processwire-2.6.18-updates-pagination-and-seo/#new-http-prefix-available-for-all-config-gt-urls-properties

In the API:
https://processwire.com/api/ref/paths/

Easy to miss this one.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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