新手请教ci问题~第一次学习ci,还望大侠们多多指教
自己看视频学习ci,发现视频的版本和2.0有很大的差别第一个问题是视频中http://localhost/index.php/blog/index/是可以访问首页的,而我这里则是404。
第二个问题:
class Shufa extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$data['page_title'] = "xxx";
$data['news1'] = $this->Action->get_new1();
$data['news2'] = $this->Action->get_new2();
$this->load->view('header',$data);
$this->load->view('index',$data);
$this->load->view('footer');
}
function news()
{
$data['page_title'] = "xxx";
$this->Action->get_content($this->url->segment(3));
$this->load->view('header',$data);
$this->load->view('news',$data);
$this->load->view('footer');
}
}
写完这些后我在view下新建了news.php,但是无论怎么访问也都是404,求解 http://localhost/index.php/Shufa/news/ 应该是你应该访问的地址 上面的代码我是把blog给改掉了~
即使我在地址栏输入 http://localhost/index.php/shufa/index/ 依然是404 http://localhost/blog/index.php/shufa/index/ 如果你有文件夹,要写上文件夹的
页:
[1]