Download the PHP package zero-to-prod/url without Composer
On this page you can find all versions of the php package zero-to-prod/url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zero-to-prod/url
More information about zero-to-prod/url
Files in zero-to-prod/url
Package url
Short Description A DataModel for a Url
License MIT
Homepage https://github.com/zero-to-prod/url
Informations about the package url
Zerotoprod\Url
Contents
- Introduction
- Requirements
- Installation
- Usage
- Helper Methods
- Suggested Traits
- Local Development
- Contributing
Introduction
Parse and access url components with a class.
Requirements
- PHP 7.1 or higher.
Installation
Install Zerotoprod\Url
via Composer:
This will add the package to your project’s dependencies and create an autoloader entry for it.
Usage
Use the from()
static method to map array keys to class properties.
It is recommended to extend your own Url class with the \Zerotoprod\Url\Url
class.
Helper Methods
The Url
class includes several helper methods for constructing URLs with specific schemes and ports.
Suggested Traits
Parsable
The Parsable trait provides a method for parsing a URL string and ensuring that it starts with a supported protocol. This is useful when you want to handle various types of URLs and ensure they conform to a specific format before processing.
Installation
The Parsable trait is included within this package, so no additional installation is required.
Usage
To use the Zerotoprod\Url\Parsable
trait in your class, simply include it:
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
All versions of url with dependencies
zero-to-prod/dynamic-setter Version ^71.0
zero-to-prod/data-model Version ^81.0