Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:formvalidator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:core:formvalidator [2026/09/26 09:09] – admin adminscriptlog:lib:core:formvalidator [2026/09/26 09:34] (current) – admin admin
Line 10: Line 10:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Core Class | +| ''@category'' | Core Class | 
-  | ''@author'' | SchizoDuckie | +| ''@author'' | SchizoDuckie | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@see'' | https://stackoverflow.com/questions/737385/easiest-form-validation-library-for-php#738510 |+| ''@see'' | https://stackoverflow.com/questions/737385/easiest-form-validation-library-for-php#738510 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 24: Line 24:
 //None.// //None.//
  
-======= Properties (1) =======+======= Properties (8) =======
  
-  ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ +^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
-  | ''public static'' | ''static'' | ''$regexes'' | ''array( 'date' => "^[0-9]{4}[-/][0-9]{1,2}[-/][0-9]{1,2}\$",…'' | 20 |+| ''public static'' | ''static'' | ''$regexes'' | ''array( 'date' => "^[0-9]{4}[-/][0-9]{1,2}[-/][0-9]{1,2}\$",…'' | 20 | 
 +| ''private'' | ''(untyped)'' | ''$validations'' |  | 37 | 
 +| ''private'' | ''(untyped)'' | ''$sanitations'' |  | 39 | 
 +| ''private'' | ''(untyped)'' | ''$mandatories'' |  | 41 | 
 +| ''private'' | ''(untyped)'' | ''$equal'' |  | 43 | 
 +| ''private'' | ''(untyped)'' | ''$errors'' |  | 45 | 
 +| ''private'' | ''(untyped)'' | ''$corrects'' |  | 47 | 
 +| ''protected'' | ''(untyped)'' | ''$fields'' |  | 49 |
  
 ======= Methods (7) ======= ======= Methods (7) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | (undocumented) | 51 | +| public | ''__construct()'' | (undocumented) | 51 | 
-  | public | ''validate()'' | Validates an array of items (if needed) and returns true or false | 68 | +| public | ''validate()'' | Validates an array of items (if needed) and returns true or false | 68 | 
-  | public | ''getJSON()'' | (undocumented) | 126 | +| public | ''getJSON()'' | (undocumented) | 126 | 
-  | public | ''sanitize()'' | Sanatizes an array of items according to the $this->sanitations | 159 | +| public | ''sanitize()'' | Sanatizes an array of items according to the $this->sanitations | 159 | 
-  | private | ''addError()'' | Adds an error to the errors array. | 177 | +| private | ''addError()'' | Adds an error to the errors array. | 177 | 
-  | private static | ''sanitizeItem()'' | Sanatize a single var according to $type. | 187 | +| private static | ''sanitizeItem()'' | Sanatize a single var according to $type. | 187 | 
-  | public static | ''validateItem()'' | Validates a single var according to $type. | 223 |+| public static | ''validateItem()'' | Validates a single var according to $type. | 223 |
  
  
Line 49: Line 56:
 //lines 51–59 (9)// //lines 51–59 (9)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$validations'' | ''(untyped)'' | ''array()'' | //none// | +|  ''$validations'' |  ''(untyped)'' |  ''array()'' |  //none// | 
-  | ''$mandatories'' | ''(untyped)'' | ''array()'' | //none// | +|  ''$mandatories'' |  ''(untyped)'' |  ''array()'' |  //none// | 
-  | ''$sanitations'' | ''(untyped)'' | ''array()'' | //none// | +|  ''$sanitations'' |  ''(untyped)'' |  ''array()'' |  //none// | 
-  | ''$equal'' | ''(untyped)'' | ''array()'' | //none// |+|  ''$equal'' |  ''(untyped)'' |  ''array()'' |  //none// |
  
  
Line 70: Line 77:
 Also the types of non mandatory fields were not checked. Also the types of non mandatory fields were not checked.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$items'' | ''(untyped)'' | //required// | //none// |+|  ''$items'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 103: Line 110:
 $sanitations = array('fieldname', 'otherfieldname'=>'float'); $sanitations = array('fieldname', 'otherfieldname'=>'float');
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$items'' | ''(untyped)'' | //required// | //none// |+|  ''$items'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 119: Line 126:
 Adds an error to the errors array. Adds an error to the errors array.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$field'' | ''(untyped)'' | //required// | //none// | +|  ''$field'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$type'' | ''(untyped)'' | '''string''' | //none// |+|  ''$type'' |  ''(untyped)'' |  '''string''' |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 138: Line 145:
 Allows for static calling to allow simple sanatization Allows for static calling to allow simple sanatization
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$var'' | ''(untyped)'' | //required// | //none// | +|  ''$var'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$type'' | ''(untyped)'' | //required// | //none// |+|  ''$type'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 157: Line 164:
 Allows for static calling to allow simple validation. Allows for static calling to allow simple validation.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$var'' | ''(untyped)'' | //required// | //none// | +|  ''$var'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$type'' | ''(untyped)'' | //required// | //none// |+|  ''$type'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
scriptlog/lib/core/formvalidator.1790413761.txt.gz · Last modified: by admin