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 Parse a url into a class.
License MIT
Homepage https://github.com/zero-to-prod/url
Informations about the package url
Zerotoprod\Url
Parse and access url components with a class.
Installation
Install the package via Composer:
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:
Transformable
The Transformable trait provides methods to convert an object’s properties into an array or a JSON string. This is particularly useful for serializing your data models.
Usage
To use the Zerotoprod\Transformable\Transformable
trait in your class, simply include it:
All versions of url with dependencies
zero-to-prod/dynamic-setter Version ^71.0
zero-to-prod/data-model Version ^71.0