baraja-core/url
最新稳定版本:v1.1.5
Composer 安装命令:
composer require baraja-core/url
包简介
Simple URL manager.
README 文档
README
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();
Or relative URL:
// return with query parameters (if used) echo \Baraja\Url\Url::get()->getRelativeUrl(); // return only path echo \Baraja\Url\Url::get()->getRelativeUrl(false);
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.
统计信息
- 总下载量: 376.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 20
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-20