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

Feature request: Switching between classes by theme #687

Open
ukeloop opened this issue Apr 28, 2022 · 9 comments
Open

Feature request: Switching between classes by theme #687

ukeloop opened this issue Apr 28, 2022 · 9 comments

Comments

@ukeloop
Copy link
Contributor

ukeloop commented Apr 28, 2022

I would like to have the ability to set a Theme for each form and switch the classes, etc. listed in the config.

@rudiedirkx
Copy link
Collaborator

Sounds good. Sounds like a PR!

@ukeloop
Copy link
Contributor Author

ukeloop commented Apr 30, 2022

Do you think we should always not include template_prefix in Templates? If Templates has template_prefix, it's duplicated.

@rudiedirkx
Copy link
Collaborator

Eh? Do you mean template_prefix in the config file? I don't use it, but it works, right?

@ukeloop
Copy link
Contributor Author

ukeloop commented May 1, 2022

I would like to change the view file as well for each Theme.

return [
    'themes' => [
        'default' => [
            // ...

            'template_prefix' => 'laravel-form-builder::',
        ],
        'foo' => [
            // ...

            'template_prefix' => 'forms.foo.',
        ],
    ],

    // ...
];

Templates doesn't need have template prefix.

@rudiedirkx
Copy link
Collaborator

I don't get it. What is Templates?

It's dangerous to change the entire config structure. That would probably break bc.

@ukeloop
Copy link
Contributor Author

ukeloop commented May 10, 2022

So it is not PR, it's issue.

If it is difficult to change only class, as in the case of Horizontal form, it is necessary to change view files.

I currently use form_label and form_widget instead of form_row when I need a form with a special layout.

@rudiedirkx
Copy link
Collaborator

I use form and row classes and custom CSS to do different layouts. There's many ways to do this. And every dev can do them. How much effort do you want to put into themes that won't work for everyone, but have to work for more than just yourself?

@ukeloop
Copy link
Contributor Author

ukeloop commented May 15, 2022

But Symfony form can change view files by theme.

@rudiedirkx
Copy link
Collaborator

This form builder isn't much like Symfony anymore. But you can PR anything you like, and if it's backward compatible, we might add it. That's the most important IMO: backward compatible.

@ukeloop ukeloop changed the title Switching between classes by theme Feature request: Switching between classes by theme Apr 17, 2023
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

2 participants