简体   繁体   English

在 Codeigniter 3 中找不到您请求的页面

[英]The page you requested was not found in Codeigniter 3

When I load the view user/propertie_key/key_propertie_list returns error 404当我加载视图user/propertie_key/key_propertie_list返回错误 404

And this is my Controller这是我的控制器

class Key_propertie extends UR_Controller {

public function __construct(){
    parent::__construct();
    $this->load->model("user/key_propertie_model", "key_propertie_model");
        $this->load->library('datatable');
}

public function index(){

    $lista = $this->key_propertie_model->getKey();
    $dados = array("ci_broker_propertie_key" => $lista);

    $dados['view'] = 'user/propertie_key/key_propertie_list';
        $this->load->view('layout', $dados);
}

This is the error that returns me on the console.这是在控制台上返回我的错误。

在此处输入图片说明

And here is the full view path这是完整的视图路径

在此处输入图片说明

You are attempting to load the viewfile layout.php, which is not in your directory, hence the error您正在尝试加载视图文件 layout.php,该文件不在您的目录中,因此出现错误

the correct approach is:正确的做法是:

public function index(){
    $lista = $this->key_propertie_model->getKey();
    $dados = array("ci_broker_propertie_key" => $lista);
    $this->load->view('user/propertie_key/key_propertie_list', $dados);
}

please try to like this example, hope so work for you请尝试喜欢这个例子,希望对你有用

public function index(){
         $data =array();
        $data['lista'] = $this->key_propertie_model->getKey();
        $data['view'] = 'load here your view page directory';
        $this->load->view('load layouts here', $data);
    }

我用 URL 上的user/propertie_key properie_key 解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM