Skip to content

Commit 1c4e3a7

Browse files
committed
Form: added setHtmlAttribute()
1 parent 6d792ea commit 1c4e3a7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Forms/Form.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ public function isMethod(string $method): bool
203203
}
204204

205205

206+
/**
207+
* Changes forms's HTML attribute.
208+
* @return static
209+
*/
210+
public function setHtmlAttribute(string $name, $value = true)
211+
{
212+
$this->getElementPrototype()->$name = $value;
213+
return $this;
214+
}
215+
216+
206217
/**
207218
* Cross-Site Request Forgery (CSRF) form protection.
208219
*/

0 commit comments

Comments
 (0)