gpt4 book ai didi

php - 无法定位您指定的型号 : modelName

转载 作者:可可西里 更新时间:2023-11-01 00:50:12 24 4
gpt4 key购买 nike

我正在尝试加载这个模型:

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

}

这是我的 Controller 所在的地方:

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

为什么会出现此错误?

无法找到您指定的型号:菜单

最佳答案

CodeIgniter 找不到模型文件。如果您将模型命名为 Menu,请确保文件名为 menu.php 而不是 menu_model.php 之类的其他名称。

关于php - 无法定位您指定的型号 : modelName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9315706/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com