Url
class Url (View source)
Static methods for URL/hidden inputs generating
Methods
Generates text with hidden inputs.
create hidden form fields from array with name => value
Generates text with URL parameters.
Generates text with URL parameters.
No description
No description
No description
Returns url separator character used for separating url parts.
No description
No description
Details
static string
getHiddenInputs(string|array $db = '', string $table = '', string $skip = '')
Generates text with hidden inputs.
static string
getHiddenFields(array $values, string $pre = '', bool $isToken = false)
create hidden form fields from array with name => value
$values = array(
'aaa' => aaa,
'bbb' => array(
'bbb_0',
'bbb_1',
),
'ccc' => array(
'a' => 'ccc_a',
'b' => 'ccc_b',
),
);
echo Url::getHiddenFields($values);
// produces:
<input type="hidden" name="aaa" Value="aaa">
<input type="hidden" name="bbb[0]" Value="bbb_0">
<input type="hidden" name="bbb[1]" Value="bbb_1">
<input type="hidden" name="ccc[a]" Value="ccc_a">
<input type="hidden" name="ccc[b]" Value="ccc_b">
static string
getCommon(array $params = [], string $divider = '?', bool $encrypt = true)
Generates text with URL parameters.
$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
static string
getCommonRaw(array $params = [], string $divider = '?', bool $encrypt = true)
Generates text with URL parameters.
$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
static string
buildHttpQuery(array $params, bool $encrypt = true)
No description
static string
encryptQuery(string $query)
No description
static string|null
decryptQuery(string $query)
No description
static string
getArgSeparator()
Returns url separator character used for separating url parts.
Extracted from 'arg_separator.input' as set in php.ini, but prefers '&' and ';'.
static string
selectArgSeparator(string|false $separator)
No description
static string
getFromRoute(string $route, array $additionalParameters = [], bool $encrypt = true)
No description