-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
FormRow: allow attributes for <fieldset> wrapper #62
Comments
@Slamdunk
The question which arise here: is the FormRow helper the correct place to handle the fieldset? The helper FormCollection already contains a "wrapper" functionality. Maybe we can adopt this functionality to all helper with multiple elements and also for the FormRow helper itself. This would allow to create custom wrappers for the different element types and to create a markup with the FormRow helper which is used by CSS frameworks like Bootstrap, Tailwind and Co. Please attach further ideas and thoughts! |
That's indeed a good suggestion 👍
In fact that's what I was looking for: avoid custom styling and rely solely to external CSS tools. This should be the path for any view helper these days: classes allowed everywhere 🚢 |
I think the goal for standard forms should be: <?= $this->form($form) ?> which means we need support for configurations like this: return [
'view_helper_config' => [
'form_row' => [
'input_error_class' => 'is-invalid',
'wrapper' => '…',
'label_wrapper' => '…',
],
],
]; or (pseudo code) return [
'view_helper_config' => Laminas\Form\View\Helper\HelperConfig::BOOTSTRAP,
];
return [
'view_helper_config' => Laminas\Form\View\Helper\HelperConfig::FOUNDATION,
]; Compare also with |
Hi, so far the
<fieldset>
wrapper for multi-checkbox, radio and so on can't have attributes since the rendered html is hard-coded:laminas-form/src/View/Helper/FormRow.php
Lines 193 to 202 in c3ad4db
For the multi-checkbox, an hypothetical
$multiCheckbox->setAttribute('fieldset_class' => 'foo');
could be retrieved and injected: we should think of a comprehensive solution for all the involved elements though.The text was updated successfully, but these errors were encountered: