首页 > 解决方案 > 在codeigniter 3中传递参数以查看无限循环/页面刷新

问题描述

我对 CodeIgniter 3 有一些问题。当我尝试使用这些参数访问 URL 时http://localhost/crm/Customer/update/3

结果是无限循环页面刷新。如果我访问其他视图或 URL,则不会发生这种情况。

例如 :http://localhost/crm/Customer/list

下面是我的控制器文件:

class Customer extends CI_Controller {
    function __construct() {
        parent::__construct();
        $this->load->helper(array('form', 'url', 'customer'));
        $this->load->database();
        $this->load->library('session');
        $this->load->model(array('Auth', 'Model_customer'));
        $this->_init();
    }

    function _init() {

        $this->output->set_template('index');
        // $this->load->section('sidebar','template/sidebar');
    }

    public function index(){
        ...
        $this->load->view('customer/index');
    }

    function update($id) {

        // TEST
        $data['id'] = $id;
        $this->load->view('customer/update2', $data);
    }
}

任何帮助都是有价值的。谢谢

标签: phpcodeigniter

解决方案


推荐阅读