Home >Backend Development >PHP Tutorial >PHP对象调用函数失败

PHP对象调用函数失败

WBOY
WBOYOriginal
2016-06-20 12:45:56925browse

不知道为什么,控制器中代码已写好,但是通过index调用的时候出现了错误
dbController.class.php文件代码:

class dbController{
function connect(){
$db = new dbModel();
$db->get();
}
}
?>

index.php文件代码:

                        require_once("./config.php");
                        require_once("./libs/controls/dbController.class.php");
                        require_once("./libs/models/dbModel.class.php");
                        require_once("./libs/views/dbView.class.php");
                        $db = new dbController();
                        $db -> conncet();
                    ?>

效果图:


回复讨论(解决方案)

定义 function conn ect(){
调用 $db -> conn cet();

太粗心了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn