嘿家伙我是codeigniter的新手我想在不同的页面上显示多重视图..我创建一个页面,我在其上创建一个编辑按钮,我希望当我点击编辑按钮我在另一页面上重新设置..我可以做什么那个. .请帮助
这是我的代码:
这是我的代码:
class Edit extends CI_Controller { function __construct() { parent::__construct(); } function edit() { $this->load->helper('url'); if($this->input->post('edit') == True) { redirect('edit'); } } }
解决方法
查看1 :(您的链接存在的位置)
<?PHP echo anchor('Edit/edit','Edit Value'); // Here Edit is your controller and edit is the function name. ?>
在编辑控制器中修改它像这样:
class Edit extends CI_Controller { function __construct() { parent::__construct(); } function edit() { $this->load->helper('url'); if($this->input->post('edit') == True) { //redirect('edit'); //Do not use this as this line will call the same function again. $this->load->view('edit_view'); // where edit_view.PHP is present in your views directory. } } }
希望这可以帮助.