1
0
Fork 0
feedizer-php/htdocs/libraries/Nibble-Forms/Nibble/NibbleForms/Field.php
2015-11-13 23:51:46 +01:00

39 lines
761 B
PHP

<?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;
}
}