Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change form template on the fly #40

Open
developerlover opened this issue May 25, 2020 · 0 comments
Open

Change form template on the fly #40

developerlover opened this issue May 25, 2020 · 0 comments

Comments

@developerlover
Copy link

developerlover commented May 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant