slim/php-view 组件加载视图里面的子栏目视图, 运行代码不在正确位置
$app->get('/', function ($request, $response, $args = []) {
$response = $this->view->render($response, 'index.php', [ 'title' => "你好", 'response' => $response ]);
});
index.php文件
render($response, 'nav.php', ['name' => "测试"])?> - 你现在访问的路由是
nav.php文件
- 首页
- 首页
运行结果:
首页 首页
你现在访问的路由是
里面,
学习是最好的投资!