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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.