?
Path : /home/admin/domains/happytokorea.com/public_html_bk/opencart/system/library/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/opencart/system/library/url.php |
<?php class Url { private $url; private $ssl; private $rewrite = array(); public function __construct($url, $ssl = '') { $this->url = $url; $this->ssl = $ssl; } public function addRewrite($rewrite) { $this->rewrite[] = $rewrite; } public function link($route, $args = '', $connection = 'NONSSL') { if ($connection == 'NONSSL') { $url = $this->url; } else { $url = $this->ssl; } $url .= 'index.php?route=' . $route; if ($args) { $url .= str_replace('&', '&', '&' . ltrim($args, '&')); } foreach ($this->rewrite as $rewrite) { $url = $rewrite->rewrite($url); } return $url; } } ?>