Elgg\Forms\StickyForms::getStickyValue PHP Метод

getStickyValue() публичный Метод

Get a specific value from cached form submission data
public getStickyValue ( string $form_name, string $variable = '', mixed $default = null, boolean $filter_result = true ) : mixed
$form_name string The name of the form
$variable string The name of the variable
$default mixed Default value if the variable does not exist in sticky cache
$filter_result boolean Filter for bad input if true
Результат mixed
    function getStickyValue($form_name, $variable = '', $default = null, $filter_result = true)
    {
        $session = _elgg_services()->session;
        $data = $session->get('sticky_forms', array());
        if (isset($data[$form_name][$variable])) {
            $value = $data[$form_name][$variable];
            if ($filter_result) {
                // XSS filter result
                $value = filter_tags($value);
            }
            return $value;
        }
        return $default;
    }