1

I have many modules on my website (CI 2.2.1) and I wanted to create a larger part of a new functionality. That's why I decided to separate newly created modules and put them into one folder inside modules folder, named i.e. new_modules. I was able to set everything to work just fine, my modules fires up almost correctly. The only problem is to access assets files in such a folder structure. Example structure:

--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 :( */

In my config file I added new path and it started to work:

$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
    APPPATH.'modules/new_modules/' => '../modules/new_modules/'
);

I'm able to access via browser to the file in normal module:

base_url().'module_1/assets/img/file_1.jpg'

but when I try to access something in new_module folder I'm getting 404. I was trying:

base_url().'new_module_2/assets/img/file_2.jpg'

and also:

base_url().'new_modules/new_module_2/assets/img/file_2.jpg'

Is there any config that needs to be edited? Or is it impossible to nest several modules in one folder inside modules directory?

shaggy
  • 1,708
  • 2
  • 15
  • 17
kacpaa
  • 95
  • 9

0 Answers0