0

My image didn't call, with the current path. How to fix it? The folder data in out of folder application.

I'm using a framework Codeigniter with Bootstrap.

<center>
          <a href="../../data/images/buying.png" data-fancybox="group" data-caption="How to Buying in Store">
          <img class="img-flu rounded mb-4" src="../../data/images/buying.png" alt="" >
</center>

1 Answers1

1

First, you need to set up this on application->config->config.php before using the base_url().

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

In view

<center>
          <a href="<?php echo base_url() ?>data/images/buying.png" data-fancybox="group" data-caption="How to Buying in Store">
          <img class="img-flu rounded mb-4" src="<?php echo base_url() ?>data/images/buying.png" alt="" >
</center>

For more info about the proper setup or uses of base_url()

How to set proper codeigniter base url?

N. Alcuino
  • 130
  • 1
  • 7