Bitrix Site Manager

DelFilterEx

DelFilterEx(
 array vars,
 string id, 
 bool session = true
)

The function DelFilterEx clears variables that contain filter values and clears corresponding session parameters.

Note
The function handles variables of the global scope. Take it into account when creating the main component files.

Parameters

ParameterDescription
vars Array of filter variables names.
id The filter ID identifying this filter in the session array: $_SESSION["SESS_ADMIN"][id].
session Specifies to use the session. If true, the filter values will also be deleted from the session array $_SESSION["SESS_ADMIN"][id].

See Also

Example



<?
$FilterArr = Array(
    "find_id",
    "find_id_exact_match",
    );

// if "Set filter" is clicked...
if (strlen($set_filter)>0) 
{
    // remember the filter values in the session
    InitFilterEx($FilterArr,"ADV_BANNER_LIST","set"); 
}
else 
{
    // initialize the filter values from the session
    InitFilterEx($FilterArr,"ADV_BANNER_LIST","get");
}

// if "Reset filter" is clicked
if (strlen($del_filter)>0) DelFilterEx($FilterArr,"ADV_BANNER_LIST");

$arFilter = Array(
    "ID"                    => $find_id,
    "ID_EXACT_MATCH"        => $find_id_exact_match,
    );
$rsBanners = CAdvBanner::GetList($by, $order, $arFilter, $is_filtered);
?>