按照慕课网弄的,想把smarty模版放入mvc模式中,但是出现了这个错误就不知道咋办了
fatal error: call to undefined function newtestcontroller() in d:\maizi\mvc\function.php(6) : eval()'d code on line 1
把$name与$method打印出来
然后看看$name.Controller这个文件和class是否存在,
例如$name是abc,$method是test
则在controller中找有没有class abcController,然后看看这个class下有没有test() 方法
错误说 newtestController() 函数不存在
你书写的是 eval('$obj=new'.$name.Controller(); ....
明显少了个空格,应该写作
eval('$obj=new '.$name.Controller(); ....
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号