initial commit
This commit is contained in:
commit
1cc4bf3572
254 changed files with 63622 additions and 0 deletions
htdocs/libraries/Nibble-Forms/Nibble/NibbleForms/Field
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Nibble\NibbleForms\Field;
|
||||
|
||||
use Nibble\NibbleForms\Useful;
|
||||
|
||||
abstract class Options extends BaseOptions
|
||||
{
|
||||
|
||||
public function validate($val)
|
||||
{
|
||||
if ($this->required) {
|
||||
if (Useful::stripper($val) === false) {
|
||||
$this->error[] = 'is required';
|
||||
}
|
||||
}
|
||||
if (in_array($val, $this->false_values)) {
|
||||
$this->error[] = "$val is not a valid choice";
|
||||
}
|
||||
|
||||
return !empty($this->error) ? false : true;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue