| @@ 81-93 (lines=13) @@ | ||
| 78 | * @param array $args filed configuration |
|
| 79 | * @return FieldsBuilder |
|
| 80 | */ |
|
| 81 | public function addLayout($layout, $args = []) |
|
| 82 | { |
|
| 83 | if ($layout instanceof FieldsBuilder) { |
|
| 84 | $layout = clone $layout; |
|
| 85 | } else { |
|
| 86 | $layout = new FieldsBuilder($layout, $args); |
|
| 87 | } |
|
| 88 | ||
| 89 | $layout = $this->initializeLayout($layout, $args); |
|
| 90 | $this->pushLayout($layout); |
|
| 91 | ||
| 92 | return $layout; |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * Add multiple layouts either via an array or from another builder |
|
| @@ 100-112 (lines=13) @@ | ||
| 97 | * @param FieldsBuilder|array $layouts |
|
| 98 | * @return $this |
|
| 99 | */ |
|
| 100 | public function addLayouts($layouts) |
|
| 101 | { |
|
| 102 | foreach ($layouts as $layout) { |
|
| 103 | if ($layout instanceof FieldsBuilder) { |
|
| 104 | $layout = clone $layout; |
|
| 105 | } else { |
|
| 106 | $layout = new FieldsBuilder($layout); |
|
| 107 | } |
|
| 108 | $layout = $this->initializeLayout($layout); |
|
| 109 | $this->pushLayout($layout); |
|
| 110 | } |
|
| 111 | return $this; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * Configures the layout FieldsBuilder |
|