Type checking functions.
More...
Public Member Functions |
| check ($a_type, $a_value, $a_required=false, $a_min="", $a_max="") |
| Check input.
|
Detailed Description
Type checking functions.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 31 of file class.ilTypeCheck.php.
Member Function Documentation
ilTypeCheck::check |
( |
|
$a_type, |
|
|
|
$a_value, |
|
|
|
$a_required = false , |
|
|
|
$a_min = "" , |
|
|
|
$a_max = "" |
|
) |
| |
Check input.
- Parameters
-
string | type |
mixed | value |
boolean | required |
Definition at line 40 of file class.ilTypeCheck.php.
References $lng, and $ok.
Referenced by ilHtmlBlockGUIGen\checkInputHtmlBlock().
{
switch ($a_type)
{
case "varchar":
case "text":
if ($a_required && $a_value == "")
{
$err = $lng->txt("msg_input_is_required");
}
break;
case "int":
break;
case "datetime":
if ($a_required && $a_value == "")
{
$err = $lng->txt("msg_input_is_required");
}
break;
case "boolean":
case "enum":
break;
default:
die ("ERROR: ilTypeCheck::check: Type '".$a_type."' unknown.");
break;
}
if ($err != "")
{
}
return array(
"ok" =>
$ok,
"error" => $err);
}
The documentation for this class was generated from the following file: