Difference between #1 and #2 of
URL component access functions

Revision #2 has been created by Steve Friedl on Mar 11, 2011, 3:27:21 PM with the memo:

Updated url/requestUri info
« previous (#1)


Title unchanged

URL component access functions

Category unchanged


Yii version unchanged

Tags unchanged

URL, request

Content changed

The names on the left are the properties of `CHttpRequest`, and can be accessed via `Yii::app()->request->hostInfo` and the like.

A few notes:

* If the `index.php` script is directly under the webroot, [CHttpRequest::baseUrl] will return an empty string
* Though it appears that [CHttpRequest::url] and [CHttpRequest::requestUr
li] return the same value, the underlying code is different and it's not clear how the differences manifest themselves (Update: in 1.1.7, the two ***will*** be the same) * There doesn't appear to be a single method to return the entire request URL in a single step; one can concatenate [CHttpRequest::hostInfo] and [CHttpRequest::url] to achieve this
28 0
Viewed: 14 101 times
Version: 1.1
Category: Tips
Tags: request, URL
Written by: Steve Friedl
Last updated by: Steve Friedl
Created on: Mar 11, 2011
Last updated: 7 years ago
Update Article


View all history