dsg41888 2014-08-31 14:37
浏览 65

MY_Controller重定向Codeigniter

I use codeigniter. And I am trying to set up a redirection true or false in MY_Controller.php

Once the install process is complete it should let me let me have access to the front end and back end.

But now when I go to the admin url it sends me back to install url even though it is installed how do I fix my problem. I want to have access to admin and front end after installed.

All Controllers extend MY Controller.

<?php

class MY_Controller extends MX_Controller {

    function __construct() {
        parent::__construct();

        if($this->config->item('installed') !== FALSE) {
            redirect('install');    
        } else {
            return TRUE;
        }

    }
}

Config.php

/*
|--------------------------------------------------------------------------
| Install Wizard Setup
|--------------------------------------------------------------------------
|
| This checks if you have set gone through install process
| else get redirected. This corresponds with MY_Controller.php
| All Controllers Extend Class Now Renamed MY_Controller from
| MX_Controller 
| FALSE REDIRECTS TO INSTALL, TRUE HAS ACCESS TO MAIN SITE
|
*/
$config['installed'] = TRUE;
  • 写回答

2条回答 默认 最新

  • douxiangui5011 2014-08-31 15:20
    关注

    I guess if its TRUE means its installed,then you need to check this condition

    if($this->config->item('installed') !== FALSE)
    

    this should go like this

    if($this->config->item('installed') == FALSE)
    

    Feel free to let me know if any issues.

    评论

报告相同问题?

悬赏问题

  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教