Adding a class to the form tag

blackcat562
Member | 10
+
0
-

Is there a way to add a class to the <form> tag?

David Matějka
Moderator | 6445
+
+3
-

Yes, there are a few ways:

  • you can add a class directly in PHP using $form->getElementPrototype()->class('my-class')
  • or if you are rendering a form manually in latte, you can set a class in macros using {form myForm class => 'abc'} or <form n:name='myForm' class='abc'>
blackcat562
Member | 10
+
0
-

Thank you!