codeignitercodeigniter-hmvc

Image error in hmvc CodeIgniter


Image Location :

application / modules / user / views / img / food.jpg

and my script :

<img src="<?php echo base_url(); ?>application/modules/user/views/img/food.jpg">

Can you tell me the best way to show the image profile ?


Solution

  • As the folder says, application should be only used for the application, not for the public data like one image published on the html.

    You should place the image outside the application folder. Like the images folder on the root of your project.

    • Root of your project
      |- Application
      |- cache
      |- codeigniter
      |- css
      ...
      |- images <---------------- this one
      ....

    And the link should be something like:

    <img src="<?php echo base_url(); ?>images/food.jpg">