The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validate Class
#1
Hi everybody,

Do you have some documentation about "parameters' of Validate Class, because I have been one error like this:


Notice: Undefined index: display in C:\xamppadm\htdocs\appreq\users\classes\Validate.php on line 33 error.

In video about Validate I don't saw nothing about 'display' parameter.

Thanks
  Reply
#2
Here's an example:

Code:
$rules      = [
Code:
"name" => [
Code:
"display"       => "Username",
Code:
"required"      => true,
Code:
"unique_update" => "users,".$userId,
Code:
"min"           => 1,
Code:
"max"           => 25
Code:
]
Code:
];
Code:
$validation = new Validate();
Code:
$validation->check($_POST, $rules);
Code:
if ($validation->passed()) {};
  Reply
#3
The display parameter is what the form control is called in the error message.

Code:
Username already exists. Please choose another Username. // "display" => "Username"
Code:
Email already exists. Please choose another Email. // "display" => "Email"

For all the other parameters, you can look them up in users/classes/Validate.php and see the full list (we also have a post in the modifications subforum that has additional custom validations), but display is the only parameter that isn't an actual validation rule.
  Reply
#4
Thanks for your suggestions, it's work well.
'display' is a property of Class, cool.
I opened the Class and saw others importants details.
Hugs
  Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)