public function __construct($view_file) { $this->view_file = $view_file; $this->baseUrl = Fm::applicationPath(); }
public static function baseUrl() { static $base_url; if ($base_url) { return $base_url; } $url = self::createUrl(array(), false, false); $urla = explode('/', $url); $url = array_shift($urla); if (empty($url)) { $url = array_shift($urla); } $base_url = ((empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] === 'off') ? 'http' : 'https') . '://'; $base_url .= $_SERVER['HTTP_HOST']; $base_url = $base_url . '/' . $url . '/' . Fm::applicationPath() . '/'; return $base_url; }