Route name for form() function in templates

By default we need to set a full uri in form() function to build a <form> in template, for example:

{{ form('some/great/action/', 'id': 'great_form') }}
    {{ form.render('some_input') }}
    {{ submit_button('Submit') }}
</form>

I can set a name (for example 'great') for route via RouteInterface->setName() function, but can I use this name in templates?



89.8k

You can pass an array as first parameter indicating the name of the route:

{{ form(['for': 'great_form']) }}

It's cool, thanks!