Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 73 | All time: 10,232 This week: 673![]() |
Version | License | PHP version | Categories | |||
pathuri 1.0 | MIT/X Consortium ... | 5 | HTTP, PHP 5, Parsers |
Description | Author | |
This package can parse and edit the URI of a site page. |
Powerful while Remaining Simple to use library to ease URL parsing and editing in PHP.
__PathJoinedUri__
Basic Path Interfaces iPathJoinedUri
### Build object from construct ---------------------------------------------------
$joinedPath = new PathJoinUri([
# (!) when you pass a path on construct
# you have to set separator
'path' => '/var/www/html/', # <-----
# |
# path also can build upon series of array list | same in path
'path' => ['', 'var', 'www', 'html'], # <-----
# ^ this mean absolute path starting with "/"
# (!) in this form separator is not necessary
# default separator is "/"
'separator' => '/'
]);
### Build Existing Object -------------------------------------------------------
$newPath = (new PathJoinUri)->setSeparator('\\');
# ^ you have to set separator before parse()
$parsedUri = $newPath->parse('\\..\\htdocs\\project\\');
# = ['path' => ['', '..', 'htdocs', 'project']]
$newPath->fromArray($parsedUri);
## print out path
echo $newPath
->toString()
.'<br/>';
# output : \..\htdocs\project
### Append/Prepend Paths --------------------------------------------------------
$joinedPath->append($newPath);
echo $joinedPath->toString().'<br/>';;
# output: /var/www/html/../htdocs/project
# normalize output
echo $joinedPath->normalize()->toString().'<br/>';;
# output: /var/www/htdocs/project
# (!) Paths starting with "../" turning path into relative on normalize
$joinedPath->prepend(new PathJoinUri(['path' => '/../relative']));
echo $joinedPath->toString().'<br/>';
# output: /../relative/var/www/htdocs/project
echo $joinedPath->normalize()->toString().'<br/>';
# output: relative/var/www/htdocs/project
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() |
Class | Class source | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() ![]() |
Aux. | Auxiliary script |
![]() |
/ | Interfaces |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.