簡體   English   中英

在 Codeigniter 3 中找不到您請求的頁面

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

當我加載視圖user/propertie_key/key_propertie_list返回錯誤 404

這是我的控制器

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);
}

這是在控制台上返回我的錯誤。

在此處輸入圖片說明

這是完整的視圖路徑

在此處輸入圖片說明

您正在嘗試加載視圖文件 layout.php,該文件不在您的目錄中,因此出現錯誤

正確的做法是:

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);
}

請嘗試喜歡這個例子,希望對你有用

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