class Url

Static methods for URL/hidden inputs generating

Methods

static string
getHiddenInputs(string|array $db = '', string $table = '', int $indent = 0, string|array $skip = [])

Generates text with hidden inputs.

static string
getHiddenFields(array $values, string $pre = '', bool $is_token = false)

create hidden form fields from array with name => value

static string
getCommon(mixed $params = [], string $divider = '?')

Generates text with URL parameters.

static string
getCommonRaw(mixed $params = [], string $divider = '?')

Generates text with URL parameters.

static string
getArgSeparator(string $encode = 'none')

Returns url separator

static string
getFromRoute(string $route, array $additionalParameters = [])

No description

Details

at line 34
static string getHiddenInputs(string|array $db = '', string $table = '', int $indent = 0, string|array $skip = [])

Generates text with hidden inputs.

Parameters

string|array $db optional database name (can also be an array of parameters)
string $table optional table name
int $indent indenting level
string|array $skip do not generate a hidden field for this parameter (can be an array of strings)

Return Value

string string with input fields

See also

at line 110
static string getHiddenFields(array $values, string $pre = '', bool $is_token = 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:

Parameters

array $values hidden values
string $pre prefix
bool $is_token if token already added in hidden input field

Return Value

string form fields of type hidden

at line 167
static string getCommon(mixed $params = [], string $divider = '?')

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

Parameters

mixed $params optional, Contains an associative array with url params
string $divider optional character to use instead of '?'

Return Value

string string with URL parameters

at line 203
static string getCommonRaw(mixed $params = [], string $divider = '?')

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

Parameters

mixed $params optional, Contains an associative array with url params
string $divider optional character to use instead of '?'

Return Value

string string with URL parameters

at line 243
static string getArgSeparator(string $encode = 'none')

Returns url separator

extracted from arg_separator.input as set in php.ini we do not use arg_separator.output to avoid problems with & and &

Parameters

string $encode whether to encode separator or not, currently 'none' or 'html'

Return Value

string character used for separating url parts usually ; or &

at line 279
static string getFromRoute(string $route, array $additionalParameters = [])

Parameters

string $route Route to use
array $additionalParameters Additional URL parameters

Return Value

string