本文整理匯總了PHP中input::isPersistent方法的典型用法代碼示例。如果您正苦於以下問題:PHP input::isPersistent方法的具體用法?PHP input::isPersistent怎麽用?PHP input::isPersistent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類input
的用法示例。
在下文中一共展示了input::isPersistent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: selfURL
/**
* Compiles URL addressing current script of current application.
*
* @param array|false $parameters set of parameters to pass in query, false
* to drop all current parameters (e.g. on creating GET form),
* provide special parameter '*' in array to start fresh set of parameters
* @param mixed $selector first of multiple optional selectors to include
* @return string URL of addressed script including optional parameters
*/
public function selfURL($parameters = array(), $selector = null)
{
$selectors = func_get_args();
$selectors = array_slice($selectors, 1);
if (!count($selectors)) {
$selectors = application::current()->selectors;
}
/*
* merge current script's input parameters with provided one
*/
if ($parameters === false) {
$parameters = array();
} else {
// find all non-persistent input parameters of current script
$currentVolatileParameters = array();
if (!array_key_exists('*', $parameters)) {
$get = input::source(input::SOURCE_ACTUAL_GET);
foreach ($get->listNames() as $name) {
if (data::isKeyword($name) && !input::isPersistent($name)) {
$currentVolatileParameters[$name] = $get->getValue($name);
}
}
}
unset($parameters['*']);
// merge volatile input with given parameters, but drop all those
// finally set NULL (to support removal per $parameters)
$parameters = array_filter(array_merge($currentVolatileParameters, $parameters), function ($item) {
return $item !== null;
});
}
/*
* utilize scriptURL() for referring to current script
*/
array_unshift($selectors, $parameters);
array_unshift($selectors, $this->script);
return call_user_func_array(array(&$this, 'scriptURL'), $selectors);
}