Twig - set the form id or class

Sometimes, when we are rendering a form in Twig templates, we need to set a custom ‘id’ or ‘class’ to a form. This is how we can achieve that:

Setting an id:

{% form_start( form, { 'attr': { 'id': 'form_person_edit'}) %}

Setting a class:

{% form_start(form,{'attr':{'class':'your-class'}}) %}