Something like codeigniter base_url for opencart?

Codeigniter has a feature base_url()

<?php echo base_url('/file')?>

which prints an absolute url,

Is there an equivalent for opencart?

+4
source share
1 answer

Look in the header.php controller file

 if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
     $this->data['base'] = $this->config->get('config_ssl');
  } else {
     $this->data['base'] = $this->config->get('config_url');
  }

Just call below from the template file.

<?php echo $base; ?>
+8
source

All Articles