Php CodeIgniter模块文件夹结构和进入资产文件
我的网站(CI 2.2.1)上有许多模块,我想创建一个新功能的更大部分。这就是为什么我决定分离新创建的模块,并将它们放在模块文件夹中的一个文件夹中,名为new_modules。我能够把一切都设置得很好,我的模块几乎正确启动。唯一的问题是访问这种文件夹结构中的资产文件。示例结构:Php CodeIgniter模块文件夹结构和进入资产文件,php,codeigniter,module,codeigniter-hmvc,Php,Codeigniter,Module,Codeigniter Hmvc,我的网站(CI 2.2.1)上有许多模块,我想创建一个新功能的更大部分。这就是为什么我决定分离新创建的模块,并将它们放在模块文件夹中的一个文件夹中,名为new_modules。我能够把一切都设置得很好,我的模块几乎正确启动。唯一的问题是访问这种文件夹结构中的资产文件。示例结构: --application/ ----modules/ ------module_1/ --------assets/ ----------img/ ------------file_1.jpg /* this file
--application/
----modules/
------module_1/
--------assets/
----------img/
------------file_1.jpg /* this file I can access by: base_url().'module_1/assets/img/file_1.jpg' */
--------controllers/
----------module_1.php
------new_modules/ /* folder where I want to hold several new modules */
--------new_module_2/
----------assets/
------------img/
--------------file_2.jpg /* I cannot access to this file */
----------controllers/
------------new_module_2.php /* but this module runs correctly, only without imgs, js and css :( */
在我的配置文件中,我添加了新路径,它开始工作:
$config['modules_locations'] = array(
APPPATH.'modules/' => '../modules/',
APPPATH.'modules/new_modules/' => '../modules/new_modules/'
);
我可以通过浏览器访问普通模块中的文件:
base_url().'module_1/assets/img/file_1.jpg'
但当我试图访问新模块文件夹中的内容时,我得到了404。我试着:
base_url().'new_module_2/assets/img/file_2.jpg'
而且:
base_url().'new_modules/new_module_2/assets/img/file_2.jpg'
是否有任何配置需要编辑?或者不可能在modules目录中的一个文件夹中嵌套多个模块