initial commit
This commit is contained in:
commit
1cc4bf3572
254 changed files with 63622 additions and 0 deletions
htdocs/libraries/Nibble-Forms/Nibble/NibbleForms
39
htdocs/libraries/Nibble-Forms/Nibble/NibbleForms/Field.php
Normal file
39
htdocs/libraries/Nibble-Forms/Nibble/NibbleForms/Field.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
namespace Nibble\NibbleForms;
|
||||
|
||||
abstract class Field
|
||||
{
|
||||
|
||||
public $custom_error = array();
|
||||
protected $form;
|
||||
public $html = array(
|
||||
'open_field' => false,
|
||||
'close_field' => false,
|
||||
'open_html' => false,
|
||||
'close_html' => false
|
||||
);
|
||||
|
||||
public function setForm($form)
|
||||
{
|
||||
$this->form = $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current field, i.e label and input
|
||||
*/
|
||||
abstract public function returnField($form_name, $name, $value = '');
|
||||
|
||||
/**
|
||||
* Validate the current field
|
||||
*/
|
||||
abstract public function validate($val);
|
||||
|
||||
/**
|
||||
* Apply custom error message from user to field
|
||||
*/
|
||||
public function errorMessage($message)
|
||||
{
|
||||
$this->custom_error[] = $message;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue