PHP Класс PMA\libraries\URL

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

getArgSeparator() публичный статический Метод

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'
Результат string character used for separating url parts usually ; or &

getCommon() публичный статический Метод

$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 '?'
Результат string string with URL parameters

getCommonRaw() публичный статический Метод

$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 '?'
Результат string string with URL parameters

getHiddenFields() публичный статический Метод

$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
Результат string form fields of type hidden

getHiddenInputs() публичный статический Метод

Generates text with hidden inputs.
См. также: 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)
Результат string string with input fields