| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Files extends TwillFormComponent |
||
| 8 | { |
||
| 9 | |||
| 10 | public $fieldNote; |
||
| 11 | public $filesizeMax; |
||
| 12 | public $buttonOnTop; |
||
| 13 | public $itemLabel; |
||
| 14 | public $note; |
||
| 15 | public $max; |
||
| 16 | |||
| 17 | public function __construct( |
||
| 18 | $name, |
||
| 19 | $label, |
||
| 20 | $renderForBlocks = false, |
||
| 21 | $renderForModal = false, |
||
| 22 | $max = 1, |
||
| 23 | $itemLabel = null, |
||
| 24 | $note = null, |
||
| 25 | $fieldNote = null, |
||
| 26 | $filesizeMax = 0, |
||
| 27 | $buttonOnTop = false |
||
| 28 | ) { |
||
| 29 | parent::__construct($name, $label, $renderForBlocks, $renderForModal); |
||
| 30 | $itemLabel = $itemLabel ?? strtolower($label); |
||
| 31 | $this->itemLabel = $itemLabel; |
||
| 32 | $this->note = $note ?? 'Add' . ($max > 1 ? " up to $max $itemLabel" : ' one ' . Str::singular($itemLabel)); |
||
| 33 | $this->fieldNote = $fieldNote; |
||
| 34 | $this->filesizeMax = $filesizeMax; |
||
| 35 | $this->buttonOnTop = $buttonOnTop; |
||
| 36 | $this->max = $max; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function render() |
||
| 42 | } |
||
| 43 | } |
||
| 44 |