【发布时间】:2014-02-09 00:21:49
【问题描述】:
我花了几个小时来制作一个简单的锚链接,但没有成功。
我的控制器是
class Welcome extends CI_Controller {
public function index()
{
$this->load->view('template');
}
public function contact()
{
$this->load->view('contact');
}
}
我的template.php 视图基本上是一个带有
<a class="menuhref"> <?php echo anchor('welcome/contact/','Contato')?> </a>
我在views 目录中也有一个contact.php。
我的config.php 是
$config['base_url'] = 'localhost';
$config['index_page'] = 'index.php';
当template.php 加载并单击链接“contato”时,我想将系统驱动到负责打开页面contact.php 的函数contact()。但是,我收到以下错误:
"/localhost/index.php/welcome/contact" 在此服务器上找不到
缺少什么?
【问题讨论】:
标签: php codeigniter anchor codeigniter-2