CFormValidator::GetAllList
CDBResult
CFormValidator::GetAllList(
mixed arFilter = array(),
)
The method GetAllList returns a list of registered validators as a CDBResult
object.
Parameters
Parameter |
Description |
arFilter |
Filtering array. The following keys are possible:
- TYPE - list of field types
|
Example
if (CModule::IncludeModule("form"))
{
$arFilter = array("TYPE" => array("text", "textarea"));
$sType = "<b>".implode("</b>, <b>", $arFilter["TYPE"])."</b>";
$rsValidators = CFormValidator::GetAllList($arFilter);
if ($rsValidators->SelectedRowsCount() > 0)
{
echo "Found validators for fields ".$sType.":<ul>";
while ($arValidator = $rsValidators->GetNext())
{
echo "<li>[".$arValidator["NAME"]."] ".$arValidator["DESCRIPTION"]."</li>";
}
echo "</ul>";
}
else
{
echo "Validators applicable to fields ".$sType." are not found.";
}
}
else
{
ShowError('The Web forms module is not installed');
}