abilioj/baseurl

A simple PHP library to get the base URL of a project

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/abilioj/baseurl

v1.0.0 2025-05-30 04:47 UTC

This package is not auto-updated.

Last update: 2025-12-27 06:17:43 UTC


README

Classe ideal para ajudar a pegar a url base de um projeto automaticamente independente de onde estiver instalado, esta classe se responsabiliza de obter a url base principal. foi feito um fork da classe Uri Base de Rafael Andrade | web.andrade@hotmail.com com algumas modificações e melhorias.

#Instruções de uso

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Pegar a url principal php</title>
</head>
<body>
	<?php
	
		require 'vendor/autoload.php';
		use abilioj\BaseURL\URL;

		echo URL::base();     // Ex: http://localhost/myapp/
		echo URL::baseDIR();  // Ex: http://localhost/myapp/subdir/

	?>
</body>
</html>

como instalar

composer require abilioj/baseurl