Search code examples
phpcodeigniterhmvccodeigniter-hmvc

Access sub folder of module in HMVC Codeigniter


I have a sub folder for uploads in my module. I am using HMVC extension for codeigniter. The structure of my application is following:
modules
--mymodule
----/controllers
----/models
----/views
----/uploads
-------/images

How can I access the images folder using URL?


Solution

  • Place uploads folder outside of application folder(root directory).

    so you can access

    <img src="<?php echo base_url(); ?>uploads/images/Logo.png" alt="">
    

    I don't think this works. Just a tip

    If folder inside application folder you can use APPPATH

    <img src="<?php echo APPPATH ?>uploads/images/Logo.png" alt="">