function base_url($path = null) { if (is_null($path)) { if (BASE_DIR == '/') { return request_scheme() . http_host(); } else { return request_scheme() . http_host() . BASE_DIR; } } else { if (BASE_DIR == '/') { return request_scheme() . http_host() . '/' . $path; } else { return request_scheme() . http_host() . BASE_DIR . '/' . $path; } } }
/** * Getting base url of application * @return string */ function base_url() { return request_scheme() . http_host() . BASE_DIR; }