我是codeigniter的初学者,我正在尝试建立一个库存系统。仪表板已经准备就绪,但是当我点击仪表板上的一个按钮时出现错误,它没有加载新产品视图我定义路线尝试了很多但没有正面结果
这是我的控制器
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Dashboard extends CI_Controller {
public function _construct(){
parent::_construct();
$this->load->database();
$this->load->model("m_inventory");
$this->load->helper('form');
$this->load->library('form_validation');
}
public function add_items(){
$this->load->view('newproduct');
}
}
和我的仪表板视图
<div class="form">
<h2>Inventory System</h2>
<div class="button1">
<a title="New account" href='<?php echo base_url ('dashboard/add_items'); ?>New product</a>
</div>
<div class="button2">
<input type="submit" name="submit" value="Current Stock" >
</div>
</div>
如果上面没有帮助你,那么分享你得到的错误和CI版本。