PHP Class PMA\libraries\URL

Show file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Methods

Method Description
getArgSeparator ( string $encode = 'none' ) : string Returns url separator
getCommon ( mixed $params = [], string $divider = '?' ) : string Generates text with URL parameters.
getCommonRaw ( mixed $params = [], string $divider = '?' ) : string Generates text with URL parameters.
getHiddenFields ( array $values, string $pre = '' ) : string create hidden form fields from array with name => value
getHiddenInputs ( string | array $db = '', string $table = '', integer $indent, string | array $skip = [] ) : string Generates text with hidden inputs.

Method Details

getArgSeparator() public static method

extracted from arg_separator.input as set in php.ini we do not use arg_separator.output to avoid problems with & and &
public static getArgSeparator ( string $encode = 'none' ) : string
$encode string whether to encode separator or not, currently 'none' or 'html'
return string character used for separating url parts usually ; or &

getCommon() public static method

$params['myparam'] = 'myvalue'; $params['db'] = 'mysql'; $params['table'] = 'rights'; note the missing ? echo 'script.php' . URL::getCommon($params); produces with cookies enabled: script.php?myparam=myvalue&db=mysql&table=rights with cookies disabled: script.php?server=1&lang=en&myparam=myvalue&db=mysql &table=rights note the missing ? echo 'script.php' . URL::getCommon(); produces with cookies enabled: script.php with cookies disabled: script.php?server=1&lang=en
public static getCommon ( mixed $params = [], string $divider = '?' ) : string
$params mixed optional, Contains an associative array with url params
$divider string optional character to use instead of '?'
return string string with URL parameters

getCommonRaw() public static method

$params['myparam'] = 'myvalue'; $params['db'] = 'mysql'; $params['table'] = 'rights'; note the missing ? echo 'script.php' . URL::getCommon($params); produces with cookies enabled: script.php?myparam=myvalue&db=mysql&table=rights with cookies disabled: script.php?server=1&lang=en&myparam=myvalue&db=mysql &table=rights note the missing ? echo 'script.php' . URL::getCommon(); produces with cookies enabled: script.php with cookies disabled: script.php?server=1&lang=en
public static getCommonRaw ( mixed $params = [], string $divider = '?' ) : string
$params mixed optional, Contains an associative array with url params
$divider string optional character to use instead of '?'
return string string with URL parameters

getHiddenFields() public static method

$values = array( 'aaa' => aaa, 'bbb' => array( 'bbb_0', 'bbb_1', ), 'ccc' => array( 'a' => 'ccc_a', 'b' => 'ccc_b', ), ); echo URL::getHiddenFields($values); produces:
public static getHiddenFields ( array $values, string $pre = '' ) : string
$values array hidden values
$pre string prefix
return string form fields of type hidden

getHiddenInputs() public static method

Generates text with hidden inputs.
See also: URL::getCommon()
public static getHiddenInputs ( string | array $db = '', string $table = '', integer $indent, string | array $skip = [] ) : string
$db string | array optional database name (can also be an array of parameters)
$table string optional table name
$indent integer indenting level
$skip string | array do not generate a hidden field for this parameter (can be an array of strings)
return string string with input fields