扫码关注官方订阅号
class Controller{ # 控制器基类
public function show(){ # 加载视图页面
require "./App/".PLATFORM."/View/".CONTROLLER."/".ACTION.".php";
}
老铁们,稳!
以上代码用了之后会导致Model层数据失效,所以修改了一下:
将以下代码放入Model中:
class Model{
# 加载视图页面
public function show(){
return "./App/".PLATFORM."/View/".CONTROLLER."/".ACTION.".php";
调用
$ind = new IndexModel();
require $ind->show();
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
以上代码用了之后会导致Model层数据失效,所以修改了一下:
将以下代码放入Model中:
class Model{
# 加载视图页面
public function show(){
return "./App/".PLATFORM."/View/".CONTROLLER."/".ACTION.".php";
}
}
调用
$ind = new IndexModel();
require $ind->show();