Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something like base_url from codeigniter for opencart?

Codeigniter has a function, base_url()

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

that prints the absolute URL,

Is there any equivalent for Opencart?

like image 411
Toni Michel Caubet Avatar asked Feb 16 '23 00:02

Toni Michel Caubet


1 Answers

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 your template file.

<?php echo $base; ?>
like image 119
Jenson M John Avatar answered Feb 23 '23 04:02

Jenson M John