| 1 |
<?php |
| 2 |
|
| 3 |
namespace ipl\Html\Contract; |
| 4 |
|
| 5 |
use ipl\Html\FormDecoration\DecoratorChain; |
| 6 |
|
| 7 |
/** |
| 8 |
* Interface for form elements that support default element decoration |
| 9 |
* |
| 10 |
* @phpstan-import-type decoratorsFormat from DecoratorChain |
| 11 |
* @phpstan-type loaderPaths array<int, array{0: class-string, 1?: string}> |
| 12 |
*/ |
| 13 |
interface DefaultFormElementDecoration |
| 14 |
{ |
| 15 |
/** |
| 16 |
* Set the default element decorators. |
| 17 |
* |
| 18 |
* The default decorators will be applied to all elements that do not have explicit decorators. |
| 19 |
* The order of the decorators is important, as it determines the rendering order. |
| 20 |
* |
| 21 |
* Please see {@see DecoratorChain::addDecorators()} for the supported array formats. |
| 22 |
* |
| 23 |
* @param decoratorsFormat $decorators |
| 24 |
* |
| 25 |
* @return $this |
| 26 |
*/ |
| 27 |
public function setDefaultElementDecorators(array $decorators): static; |
| 28 |
|
| 29 |
/** |
| 30 |
* Add custom element decorator loader paths for the elements |
| 31 |
* |
| 32 |
* Each entry must be an array with index 0: class namespace, index 1: class name suffix (optional). |
| 33 |
* |
| 34 |
* @param loaderPaths $loaderPaths |
| 35 |
* |
| 36 |
* @return $this |
| 37 |
*/ |
| 38 |
public function addElementDecoratorLoaderPaths(array $loaderPaths): static; |
| 39 |
} |