用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1479|回复: 1
收起左侧

[版本 3.x] uri_string和ruri_string输出的是一样的?

[复制链接]
发表于 2015-11-16 18:56:17 | 显示全部楼层 |阅读模式
我的uri_string和ruri_string输出的是一样的??

例如:http://www.abc.com/test/url/index/a/12
//输出:test/url/index/a/12

其中test为控制器中文件夹,url为控制器类,index为方法,a和12为传的属性和值。
 楼主| 发表于 2015-11-17 09:15:13 | 显示全部楼层
https://codeigniter.org.cn/forums/forum.php?mod=attachment&aid=MzM5Nnw5N2JiYTI4NXwxNzE1NTYyNjM3fDB8
PHP复制代码
 
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
 
class Url extends CI_Controller {
 
        public function index()
        {
                //参考例子地址,下面所有测试以这个地址为准:
                //且test为文件夹,url为控制器
                //http://loginapi.com/test/url/index/a/12
 
 
                // uri_string()  返回一个相对的 URI 字符串
                echo $this->uri->uri_string(); //输出:test/url/index/a/12
                echo '<br />-----<br />';
 
                // ruri_string()  该方法和 uri_string() 类似, 只是它用于返回路由后的 URI 。???
                echo $this->uri->ruri_string(); //输出:test/url/index/a/12
                echo '<br />-----<br />';
               
 
        }
}
 
 
 
复制代码

人生日历截图20151117091412.png

本版积分规则