| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- class LewaimaiUrl {
- //创建当前环境下的url
- public static function createUrl($path, $param = NULL)
- {
- $url = "http://" . Yii::app()->request->getServerName() . Yii::app()->createUrl($path);
- if ($param && count($param) > 0)
- {
- $paramQuery = http_build_query($param);
- $url .= "&" . $paramQuery;
- }
-
- return $url;
- }
-
- //创建微信前端的url
- public static function createWeixinUrl($path, $param = NULL)
- {
- if (LEWAIMAI_DEBUG)
- {
- $url = "http://front.lewaimai.com.cn" . "/index.php?r=" . $path;
- }
- else
- {
- $url = "http://front.lewaimai.com" . "/index.php?r=" . $path;
- }
-
- if ($param && count($param) > 0)
- {
- $paramQuery = http_build_query($param);
- $url .= "&" . $paramQuery;
- }
-
- return $url;
- }
- }
|