貝殼 发表于 2012-5-12 14:35:12

View视层和Controllers都按照Demo写,怎么会出问题?

本帖最后由 貝殼 于 2012-5-12 14:38 编辑

代码:
application\controllers\home.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

      /**
         * Index Page for this controller.
         *
         * Maps to the following URL
         *               http://example.com/index.php/welcome
         *      - or -
         *               http://example.com/index.php/welcome/index
         *      - or -
         * Since this controller is set as the default controller in
         * config/routes.php, it's displayed at http://example.com/
         *
         * So any other public methods not prefixed with an underscore will
         * map to /index.php/welcome/<method_name>
         * @see http://codeigniter.com/user_guide/general/urls.html
         */
      public function index()
      {
                $this->load->view('view_hellworld');
      }
}
?>

application\views\view_helloworld.php

<html>
<body>
<title>我的第一個CI框架!</title>
<h1>Hello World!</h1>
</body>
</html>

出错讯息:l

An Error Was Encountered

Unable to load the requested file: view_hellworld.php

RT,求助ING

see-sea 发表于 2012-5-12 15:02:46

加上function __construct(){
parent::__construct();}

see-sea 发表于 2012-5-12 15:15:24

see-sea 发表于 2012-5-12 15:02 static/image/common/back.gif
加上

哦好的
页: [1]
查看完整版本: View视层和Controllers都按照Demo写,怎么会出问题?