0
我想创建一个参考(HREF)以通过点击从一个视图到其他视图直接把我的网页:Rediecting在笨从一个视图另一种观点认为
我的代码是
我控制器,test_cont具有如下功能:
public function display(){ $this->load->view('test_view2'); }
-In我的视图我试图b/M代码:
$this->load->helper('url'); <a href="<?php echo site_url('index.php/Test_cont/display');?>">Display View 2</a>
$this->load->helper('url'); <a href="<?php echo base_url('index.php/Test_cont/display');?>">Display View 2</a>
$this->load->helper('url'); <a href="Test_cont/display">Display View 2</a>
,并在所有的情况下,当我点击我的链接显示视图2我得到错误404。我试图定义BASE_URL太
这样做的最好方法是'Display View 2',因为它可以在开发和生产服务器上运行而不会改变任何东西 –