研究STBLOG遇到的问题
有个LOGIN文件里$ref = $this->input->get('ref', TRUE);这是干什么用的,这个变量它是从哪取来的 参考 http://codeigniter.org.cn/user_guide/libraries/input.html 谢谢老大,已经解决了 标记一下,我也在看这个问题. 就是用户之前的位置或者用户输入的位置。比如说用户直接输入http://www.example.com/stblog/index.php/admin/posts/manage如果用户还没登陆的话这个地址就会转换成
http://www.example.com/stblog/index.php/admin/login?ref=/admin/posts/manage
private function _check_referrer()
{
$ref = $this->input->get('ref', TRUE); // $ref = /admin/posts/manage
$this->referrer = (!empty($ref)) ? $ref : '/admin/dashboard'; // $this->referrer = /admin/posts/manage
}
/**
* 默认执行函数
*
* @access public
* @return void
*/
public function index()
{
if($this->auth->hasLogin())
{
redirect($this->referrer); //redirect 到 /admin/posts/manage
}
.....
当用户登陆时,直接就到这个页面而不是 dashboard
页:
[1]