duanhu7615 2012-02-16 17:09
浏览 55
已采纳

无法找到您指定的模型:modelName

I am trying to load this model:

class Menu {

    function show_menu()
    {
        $obj =& get_instance();
        $obj->load->helper('url');
        $menu = anchor("start/hello/fred","Say hello to Fred |");
        $menu .= anchor("start/hello/bert","Say hello to Bert |");
        $menu .= anchor("start/another_function","Do something else |");
        return $menu;
    }

}

This is where my controller is:

function hello($name)
{
    $this->load->model('Menu');  
    $mymenu  = $this->Menu->show_menu();
}

Why do I get this error?

Unable to locate the model you have specified: menu

  • 写回答

2条回答 默认 最新

  • dsc56927 2012-02-16 17:17
    关注

    CodeIgniter can't find the file of the model. If you named your model Menu, make sure the file name is menu.php and not something else like menu_model.php.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置