PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.11
Booktics – Appointment Booking Calendar for Service Businesses v1.0.11
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
booktics / base / validation / rules / required-rule.php

required-rule.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.11, at base/validation/rules/required-rule.php

32 lines 538 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Booktics\Validation\Rules;
3
4 /**
5 * Class RequiredRule
6 */
7 class Required_Rule implements Rule {
8 /**
9 * Check the rule passed or not
10 *
11 * @param any $field
12 *
13 * @param any $value
14 *
15 * @return bool
16 */
17 public function passes( $field, $value ) {
18 return ! empty( $value );
19 }
20
21 /**
22 * Set validation message
23 *
24 * @param any $field
25 *
26 * @return string
27 */
28 public function message( $field ) {
29 return $field . ' is required';
30 }
31 }
32