在中找不到模型类在C:wampwww edirectsystemcoreLoader.php的第


Model class not found in not found in C:wampwww edirectsystemcoreLoader.php on line 303

从控制器调用模型时出错。错误:-SCREAM:忽略的错误抑制(!)致命错误:在C:''wamp''www''redirect''system''core''Loader.php的第30行找不到类"Redirection_model"我的控制器重定向.php

<?php 
 if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 class redirection extends CI_Controller {
function __construct()
{
    parent::__construct();
    //$this->layout->setLayout('layouts/main'); 
}
public function redirection_url()
{       
            if($_GET){
                $get_array = $_GET;
                $targetId = $get_array['tagid'];
                $this->load->model('redirection_model', 'redirection');
                $dynamicurl = $this->redirection->getDynamicUrl($targetId);
                if($dynamicurl){
                     $url=$dynamicurl['url'];
                     redirect($url,'refresh');
                }
                else{
                    echo "Invalid Request";
                }
            }
            else{
                echo "please pass the tagid";
               // $this->layout->view('redirection/redirection_url');
            }
    }

}

重定向_模型.php

  <?
    class redirection_model extends CI_Model {
function __construct()
{
    parent::__construct();
}
function getDynamicUrl($targetId){
    $dynamicUrl= array();
    $query = $this->db->get_where('dynamic_url', array('tagid' => $targetId))->row();
    if($query){
        $dynamicUrl['url'] = $query->url;
        $dynamicUrl['userid'] = $query->userid;
                    return $dynamicUrl;
    }
            else{
                return false;
            }
}

   }
 ?>

如果您还没有在控制器中链接视图,请插入它。还要检查配置文件夹中的路由文件,在那里你必须为你的函数和视图创建条目。