Codeigniter HMVC 基本安装
我有一个现有的 CI 2.02 工作安装,可以自动加载库和帮助程序。当我通过将核心文件和第 3 方文件放入 CI 目录中各自的位置来执行 HMVC 安装时,我收到错误
Fatal error: Cannot access empty property in C:\xampp\htdocs\APPNAME\application\third_party\MX\Loader.php on line 208
当我从 application/config/autoload.php 中删除所有帮助程序时,我得到
An Error Was Encountered
Unable to load the requested file: helpers/_helper.php
当我使用干净的 CI 安装时没有库或帮助程序自动加载,它工作得很好。我应该怎么做才能让 HMVC 和自动加载工作?
我按照其网站上的说明安装了 HMVC (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home)。我只执行了步骤 15,执行步骤 6 显示了我之前提到的错误。我在 /application/controllers 中有一个控制器文件,在 /application/models 中有一个模型文件,在 /application/views 中有一个视图文件,我将其移动到 /application/modules/site/controllers、/application/modules/site分别为 /models 和 /application/modules/site/views 。我将 config.php、autoload.php 和 database.php 保留在应用程序文件夹中。
在安装 HMVC(从他们的网站执行步骤 1-6)之前,我已经有一个现有的 CI 项目。我正在使用 application/config/autoload.php 自动加载一些库和助手(数据库、会话、文件、url、表单、文本)。
我需要显示更多信息才能找出问题所在吗?这是我的第一个 CI 项目,所以没什么特别的。谢谢!
I have a existing working installation of CI 2.02 that autoloads libraries and helpers. When I perform the HMVC installation by dropping the core and 3rd party files into their respective locations in the CI directory, I get the error
Fatal error: Cannot access empty property in C:\xampp\htdocs\APPNAME\application\third_party\MX\Loader.php on line 208
When I remove all helpers from application/config/autoload.php, i get
An Error Was Encountered
Unable to load the requested file: helpers/_helper.php
When I use a clean CI installation with no libraries or helpers autoloading, it works fine. What should I do to get HMVC and autoloading to work?
I installed HMVC by following the instructions on their website (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home). I only did Step 15 and doing Step 6 shows the error I mentioned earlier. I have a single controller file in /application/controllers, a single model file in /application/models and a single view file in /application/views which I move to /application/modules/site/controllers, /application/modules/site/models and /application/modules/site/views respectively. I left the config.php, autoload.php anad database.php as they are in the application folder.
Before installing HMVC (performing Steps 1-6 from their website), I already have a existing CI project. I am autoloading some libraries and helpers (database, session, file, url, forms, text) using application/config/autoload.php.
Is there any more info that I need to show to figure out where the problem lies in? This is my first CI project so its nothing fancy. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
升级到 2.0.3 和最新版本的 HMVC,应该可以正常工作。
Upgrade to 2.0.3 and the latest version of HMVC, it should work fine.