Cheetah
Static Public Member Functions | List of all members
Facebook\Url\FacebookUrlManipulator Class Reference

Static Public Member Functions

static removeParamsFromUrl ($url, array $paramsToFilter)
 
static appendParamsToUrl ($url, array $newParams=[])
 
static getParamsAsArray ($url)
 
static mergeUrlParams ($urlToStealFrom, $urlToAddTo)
 
static forceSlashPrefix ($string)
 
static baseGraphUrlEndpoint ($urlToTrim)
 

Detailed Description

Definition at line 31 of file FacebookUrlManipulator.php.

Member Function Documentation

◆ appendParamsToUrl()

static Facebook\Url\FacebookUrlManipulator::appendParamsToUrl (   $url,
array  $newParams = [] 
)
static

Gracefully appends params to the URL.

Parameters
string$urlThe URL that will receive the params.
array$newParamsThe params to append to the URL.
Returns
string

Definition at line 77 of file FacebookUrlManipulator.php.

◆ baseGraphUrlEndpoint()

static Facebook\Url\FacebookUrlManipulator::baseGraphUrlEndpoint (   $urlToTrim)
static

Trims off the hostname and Graph version from a URL.

Parameters
string$urlToTrimThe URL the needs the surgery.
Returns
string The $urlToTrim with the hostname and Graph version removed.

Definition at line 163 of file FacebookUrlManipulator.php.

◆ forceSlashPrefix()

static Facebook\Url\FacebookUrlManipulator::forceSlashPrefix (   $string)
static

Check for a "/" prefix and prepend it if not exists.

Parameters
string | null$string
Returns
string|null

Definition at line 147 of file FacebookUrlManipulator.php.

◆ getParamsAsArray()

static Facebook\Url\FacebookUrlManipulator::getParamsAsArray (   $url)
static

Returns the params from a URL in the form of an array.

Parameters
string$urlThe URL to parse the params from.
Returns
array

Definition at line 107 of file FacebookUrlManipulator.php.

◆ mergeUrlParams()

static Facebook\Url\FacebookUrlManipulator::mergeUrlParams (   $urlToStealFrom,
  $urlToAddTo 
)
static

Adds the params of the first URL to the second URL.

Any params that already exist in the second URL will go untouched.

Parameters
string$urlToStealFromThe URL harvest the params from.
string$urlToAddToThe URL that will receive the new params.
Returns
string The $urlToAddTo with any new params from $urlToStealFrom.

Definition at line 129 of file FacebookUrlManipulator.php.

◆ removeParamsFromUrl()

static Facebook\Url\FacebookUrlManipulator::removeParamsFromUrl (   $url,
array  $paramsToFilter 
)
static

Remove params from a URL.

Parameters
string$urlThe URL to filter.
array$paramsToFilterThe params to filter from the URL.
Returns
string The URL with the params removed.

Definition at line 41 of file FacebookUrlManipulator.php.


The documentation for this class was generated from the following file: