abilioj / baseurl
A simple PHP library to get the base URL of a project
v1.0.0
2025-05-30 04:47 UTC
Requires
- php: >=7.4
This package is not auto-updated.
Last update: 2025-09-06 04:36:21 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