在我的ci设置中,目录结构是
application
system
public_html
我的主控制器呈现视图( / home /index ),现在我希望内部索引视图呈现_mainMenu.php,该视图保存在外部,所以我尝试在/ home / index视图<?php include '../_mainMenu.php' ?>
但是这个错误发生了。
遇到严重程度PHP错误:警告
消息: include():未能打开“../mainMenu.php”以包含(include_path='.:/usr/lib/php:/usr/local/lib/
我正在构建一个PHP can应用程序,我正在尽可能多地遵循MVC模式。因此,对于页面中的每个页面或元素,我都有一个控制器文件和一个视图文件。模型就是数据库本身。
例如,在我的index.php页面上,我预先执行所有的业务逻辑,然后输出视图,该视图期待一组特定的变量:
index.php
<?php
// all the business logic here
$h = "hello";
$w = "world";
// setting up the variables that the view is expecting
$title = $h.