Download the PHP package ismaxim/urling without Composer
On this page you can find all versions of the php package ismaxim/urling. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ismaxim/urling
More information about ismaxim/urling
Files in ismaxim/urling
Package urling
Short Description URL parser and constructor in PHP
License MIT
Homepage https://github.com/ismaxim/urling
Informations about the package urling
Urling
๐โะะพะบัะผะตะฝัะฐัะธั ะฝะฐ ััััะบะพะผ โโ|โะะพะบัะผะตะฝัะฐััั ะฝะฐ ัะบัะฐัะฝััะบัะน โ
โ๏ธ Installation
To install this library - run the command below in your terminal:
๐ง Usage
๐ Concept
Three major ideas
๐ 1. Two modes to work with URL: parser mode & constructor mode.
๐ 2. Accessing to concrete part of URL with using aliases (see Aliases).
๐ 3. Base editors for processing complete URL and each part separately (see section Basic usage).
๐ Start
๐ Accessing
You can access to concrete URL part to parse it by using its basename (see Aliases) like:
Url Part | Aliases | Parser |
---|---|---|
scheme | protocol | SchemeParser |
user | username | UserParser |
pass | password | PassParser |
host | hostname, domain | HostParser |
port | PortParser | |
path | routes | PathParser |
query | params, attributes | QueryParser |
fragment | anchor | FragmetParser |
๐ถ Basic usage
Basic Editors - Base editor of URL and Base editor of part of URL cover almost all tasks: add, get, update or remove URL or values anywhere in it. Base Editors are "CRUDable" wrappers over the __parse_url()__ function from native PHP, and according to this fact, they return and modify values in a similar way. The only significant difference is the syntax of calls when parsing a URL or its parts.
๐ง Advanced usage
If you need to do something like add, get, update or delete the value of any part of the URL, but it's outside the scope of the base functionality, you can use one of the Base editors functions add, get, update or delete as a prefix with the name of a specific method as postfix appropriate for your task like:
(add, get, update, delete) + "SomeFunctionName" for the concrete task.
Note: Almost all functions will use that code convention permanently.
Examples:
- getValueByName();
- getNameValuePairs();
- etc. ...
๐งช Testing
Actually, all tests already automatically passed within CI build.
To test this library - run the command below in your terminal.
๐ค Contributing
If you have a problem that cannot be solved using this library, please write your solution and if you want to help other developers who also use this library (or if you want to keep your solution working after a new version is released, which will go to package manager dependencies) - create a pull-request. We will be happy to add your excellent code to the library!
๐ Report any bugs or issues you find on the GitHub issues.
โจ Creating custom functional
You can extend the functionality of the library with your own code, making edits to solve your problems in the parser classes. There are two types of parser classes the first and the main is URL parser, but there are others as well, - URL parts parsers. For each part is separate own parser.
Using the library or examining docs you can notice the same or similar to this record:
This entry might interpret the next way: "Hey, Urling, ask to the part 'params' on the current URL and return it value(this part)".
Basically extending functionality, you will work with a part of the URL almost all times and will processing or get the value for a specific part. To understand how to access to parser for needed part you can look at parser section, and then go to the desired parser file and write the best code in the world!
๐ Credits
๐ License
The MIT License (MIT). Please see License File for more information.