2015-01-31 1 views
0

controller.php오류 : 찾을 수 없음 404 페이지, 코드 이그나이터 내가 localhost를 넣으면

<?php 

    define('_root',$_SERVER['DOCUMENT_ROOT']); 
    include(_root.'/innoshop/application/models/model.php'); 

    // include_once 'model.php'; 

    class Controller { 
    public $model; 

    public function __construct() 
     { 
      $this->model = new Model(); 

     } 

: 8888/프로젝트 이름은, 내가 나에게

+0

글쎄, 무엇을 시도 했습니까? –

+0

은 포트 8888입니까? localhost : 8888을 열 수 있습니까? –

+0

왜 그런 식으로하는지, application/core에서 코어 파일을 만든 다음, MY_Model.php – user4419336

답변

1

도움이

404 Page Not Found 

The page you requested was not found. 

사람처럼 오류가 발생했습니다 사람들은 이것이 매우 잘못되어 있기 때문에 당신이 문서를 읽어야한다고 말한다. 이를 해결하려면 ..

class Controller extends CI_Controller{//better to give your controller a more meaningful name 

     public function __construct(){ 
      parent::__construct(); 
      //use the CI loader - the model will then be available like this $this->model->some_function(); 
      $this->load->model('model');//better to give your model a more meaningful name as well 
     } 

     //the index method allows you to use just the controller name in your URI eg localhost:8888/projectname/index.php/controller 
     public function index(){ 
      echo 'something to see'; 
     } 

     //an alternative controller method get it like localhost:8888/projectname/index.php/controller/your_method_name 
     public function your_method_name(){ 
      echo 'something to see in your method'; 
     } 

} 

당신이이 같은 URI를 사용할 수 있도록하려면 CodeIgniter의

에 .htaccess로 관련 질문에 대한 URI 검색에서 index.php를 제거하려면 localhost:8888/projectname 다음과 같은 기본 컨트롤러를 정의하는 config/routes.php에 경로를 추가해야합니다. $route['default']='controller';

관련 문제