base-field-error.php
3 years ago
checkboxes-field-error.php
3 years ago
error-handler.php
3 years ago
media-field-error.php
3 years ago
number-field-error.php
3 years ago
repeater-field-error.php
3 years ago
text-field-error.php
3 years ago
textarea-field-error.php
3 years ago
wysiwyg-field-error.php
3 years ago
base-field-error.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Blocks\Modules\Fields_Errors; |
| 5 | |
| 6 | abstract class Base_Field_Error { |
| 7 | |
| 8 | protected $name; |
| 9 | protected $message; |
| 10 | protected $params; |
| 11 | |
| 12 | abstract public function get_name(); |
| 13 | abstract public function get_title(); |
| 14 | |
| 15 | public function set_params( $params = array() ) { |
| 16 | $this->name = $params['name']; |
| 17 | $this->message = $params['message']; |
| 18 | $this->params = $params['params']; |
| 19 | } |
| 20 | |
| 21 | public function get_manager( $data = array() ) { |
| 22 | return jet_form_builder()->msg_router->get_manager( $data ); |
| 23 | } |
| 24 | |
| 25 | public function error() { |
| 26 | return $this->get_manager()->get_message( 'empty_field' ); |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |