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
Validation Class Improvements
#8
Introducing a new rule: 'in'.

In
Code:
Validate.php
, function 'check':
<pre>
Code:
    case 'in':
        if (!in_array($value, $rule_value)) {
            $this->addError(["{$display} has to be one of these: ".implode($rule_value, ','),$item]);
        }
        break;
</pre>





In user file, validation array:
<pre>
Code:
'gender' => array(
    'display' => 'Gender',
    'required' => true,
    'in' => array('m','f')
)
</pre>
  Reply


Messages In This Thread
Validation Class Improvements - by faguss - 06-20-2017, 01:18 PM
Validation Class Improvements - by karsen - 07-10-2017, 07:29 PM
Validation Class Improvements - by faguss - 07-13-2017, 09:48 PM
Validation Class Improvements - by karsen - 07-15-2017, 03:33 PM
Validation Class Improvements - by faguss - 07-15-2017, 03:41 PM
Validation Class Improvements - by karsen - 07-15-2017, 04:31 PM
Validation Class Improvements - by mudmin - 08-25-2017, 12:42 PM
Validation Class Improvements - by eeverts - 11-18-2017, 07:32 PM
Validation Class Improvements - by eeverts - 11-18-2017, 07:41 PM
Validation Class Improvements - by mudmin - 11-19-2017, 11:53 PM
Validation Class Improvements - by eeverts - 11-20-2017, 07:25 AM
Validation Class Improvements - by mudmin - 11-20-2017, 04:06 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)