Simple URL manager.

v1.1.2 2021-07-15 10:54 UTC

README

Integrity check

Simple manager to get parts of the current URL. URL resolving is done in a secure way.

📦 Installation

It's best to use Composer for installation, and you can also find the package on Packagist and GitHub.

To install, simply use the command:

$ composer require baraja-core/url

You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.

How to use

An easy-to-use library for obtaining and managing current URLs.

You will get the current URL:

echo \Baraja\Url\Url::get()->getCurrentUrl();

A base url:

echo \Baraja\Url\Url::get()->getBaseUrl();

Nette Url or Script Url can also be obtained for robust work with URL parts:

$netteUrl = \Baraja\Url\Url::get()->getNetteUrl();

echo $netteUrl->getDomain();
echo $netteUrl->getPort();
echo $netteUrl->getQuery();

And many other getters, see the documentation for more.

📄 License

baraja-core/url is licensed under the MIT license. See the LICENSE file for more details.