Skip to content

Change form template on the fly #40

@developerlover

Description

@developerlover

Hi @barryvdh !

Thank you so much for the package, it saved my life!

I wonder if there is a way of change the default form template on the fly. Maybe from a Blade view, form class or the controller...

Like symfony does from a Twig view:
{% form_theme form 'foundation_5_layout.html.twig' %}

Found that using the Config facade I can do it:
Config::set('form.theme', 'form_table_layout.html.twig');

But this it's a bit ugly because it changes the template for the following forms in the same request.

Regards,
Pablo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions