Skip to content

Commit 282ccce

Browse files
committed
update
1 parent c154fa7 commit 282ccce

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

docs/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Now render the form using:
6060

6161
Easy as that.
6262

63-
## Frameworks
63+
## Frontend frameworks
6464

6565
MintyPHP Forms has support for the Bulma framework right out of the box.
6666
Just tell MintyPHP Forms that you want to use Bulmas style forms using:
@@ -102,6 +102,10 @@ And the output will be form in the familiar Bulma style:
102102

103103
In the future we will add support for other frameworks, such as bootstrap 5.
104104

105+
## Backend frameworks
106+
107+
108+
105109
## Full example
106110

107111
Although we don't encourage you to use MintyPHP Forms without a framework, it is certainly possible:

src/Form.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,21 @@ public function field(Field $field): self
102102
*/
103103
public function fields(array $fields): self
104104
{
105+
$this->hideFieldsets = true;
106+
$fieldset = new Fieldset();
105107
foreach ($fields as $field) {
106-
$this->field($field);
108+
$fieldset->field($field);
107109
}
110+
$this->fieldset($fieldset);
111+
return $this;
112+
}
113+
114+
public function header(Header $header): self
115+
{
116+
$this->hideFieldsets = true;
117+
$fieldset = new Fieldset();
118+
$fieldset->header($header);
119+
$this->fieldset($fieldset);
108120
return $this;
109121
}
110122

0 commit comments

Comments
 (0)