Contracts
2 years ago
Exceptions
2 years ago
Registrars
2 years ago
FormDesign.php
2 years ago
ServiceProvider.php
2 years ago
FormDesign.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\FormDesigns; |
| 4 | |
| 5 | use Give\Framework\FormDesigns\Contracts\FormDesignInterface; |
| 6 | |
| 7 | /** |
| 8 | * The FormDesign is meant to be extended to create custom GiveWP form designs. |
| 9 | * |
| 10 | * @since 3.0.0 |
| 11 | */ |
| 12 | abstract class FormDesign implements FormDesignInterface |
| 13 | { |
| 14 | protected $isMultiStep = false; |
| 15 | |
| 16 | /** |
| 17 | * The unique identifier of the design |
| 18 | * |
| 19 | * @since 3.0.0 |
| 20 | */ |
| 21 | abstract public static function id(): string; |
| 22 | |
| 23 | /** |
| 24 | * THe human-readable name of the design |
| 25 | * |
| 26 | * @since 3.0.0 |
| 27 | */ |
| 28 | abstract public static function name(): string; |
| 29 | |
| 30 | /** |
| 31 | * Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory. |
| 32 | * |
| 33 | * @since 3.0.0 |
| 34 | * |
| 35 | * @return string|false |
| 36 | */ |
| 37 | public function css() |
| 38 | { |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Full URL of the script, or path of the script relative to the WordPress root directory. |
| 44 | * |
| 45 | * @since 3.0.0 |
| 46 | * |
| 47 | * @return string|false |
| 48 | */ |
| 49 | public function js() |
| 50 | { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * An array of dependencies compatible with the `$deps` parameter in wp_enqueue_script |
| 56 | * |
| 57 | * @see https://developer.wordpress.org/reference/functions/wp_enqueue_script/ |
| 58 | * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-dependency-extraction-webpack-plugin/#wordpress |
| 59 | * |
| 60 | * @return array |
| 61 | */ |
| 62 | public function dependencies(): array |
| 63 | { |
| 64 | return []; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @since 3.0.0 |
| 69 | */ |
| 70 | public function isMultiStep(): bool |
| 71 | { |
| 72 | return $this->isMultiStep; |
| 73 | } |
| 74 | } |
| 75 |