【问题标题】:Implementing Hierarchical Model View Controller (HMVC)实现分层模型视图控制器 (HMVC)
【发布时间】:2016-12-02 03:32:27
【问题描述】:

安装https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

并在模块中设置我的管理员和站点文件夹。

我收到以下错误消息:

您的应用程序文件夹路径似乎设置不正确。请打开以下文件并更正:index.php

我想知道如何解决它。

【问题讨论】:

  • $application_folder = '应用程序/站点';出现上述错误或 $application_folder = 'application/modules/site';带有新错误警告:require_once(C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci\application\modules\site\config/constants.php): 无法打开流:没有这样第 70 行 C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci\system\core\CodeIgniter.php 中的文件或目录
  • 请重新编辑您的问题,点击标签下方的编辑按钮将其粘贴到问题中

标签: codeigniter


【解决方案1】:

在您的主 index.php 上,将 $application_folder = 'application'; 作为您的应用路径,然后为您的管理员和站点模块设置路由

设置你的基本网址必须

$config['base_url'] = 'http://localhost/masterlinkci/';

路由.php

仅举例

// lower case is best for your routes.php as shown here 

$route['default_controller'] = 'site/home/index/';

$route['admin'] = 'admin/cpages/index/';
$route['something'] = 'modulename/controller/function/';

模块 > 站点 > 控制器 > Home.php

还有

模块 > 管理 > 控制器 > Cpages.php

没有

$route['default_controller'] = 'modules/site/Home';
$route['home'] = 'modules/site/Home/';
$route['admin'] = 'modules/admin/Cpages/';

注意:您可能需要在主根目录中有一个合适的 htaccess 文件

确保您还遵循http://www.codeigniter.com/user_guide/general/styleguide.html#file-naming 此处所述的文件和类命名方式

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-07
    • 2015-01-10
    相关资源
    最近更新 更多