4

When writing a plugin is there a Craft request to grab the entire url? I want to grab everything including http://domain.com/uri preferably without writing my own function.

I see getUrl but craft()->request->url only returns 'uri' of http://domain.com/uri.

Victor
  • 8,376
  • 1
  • 34
  • 61
Adam McCombs
  • 1,695
  • 12
  • 25

1 Answers1

5

You're probably looking for something like:

craft()->request->getHostInfo().craft()->request->getRequestUri();

Which will return the host name with the schema it's using (http:// or https://) as well as any URI after the host including any querystring parameters.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143