Skip to content

Commit

Permalink
FEATURE: support for configuration.formFieldWrapperClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
skurfuerst committed Mar 15, 2017
1 parent 0e4b280 commit 4a130ef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Classes/Annotations/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ final class FormField
public $options;

public $readonly = FALSE;

// generic "configuration" block to be used for specific templates
public $configuration;
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ In your Model, annotate the field using the `@Crud\FormField` annotation, which
- `editor`: configure a different editor for the forms; see below for a more detailed description.
- `options`: specify option values for e.g. radio-buttons or drop-down lists
- `repository`: specify a repository to retrieve option values from (format: full\repository\class\name[::methodName])
- `configuration`: a generic array of configuration options, available everywhere for customizations. By the base classes, the following configuration options are supported:
- `formFieldWrapperClassName`: CSS class name to be applied to the wrapping element for each form field (to have field-specific classes)


## hiding properties from listing and forms, sorting them, labeling them

Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/CrudForms/Bootstrap4/Form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<fieldset>
<f:for each="{fields}" as="field">
<div class="form-group{f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-danger')}">
<div class="form-group {field.configuration.formFieldWrapperClassName} {f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-danger')}">
<label class="form-control-label">{field.label}</label>
<f:if condition="{field.editor}">
<f:then>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/CrudForms/Form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<fieldset>
<f:for each="{fields}" as="field">
<div class="form-field{f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-error')}">
<div class="form-field {field.configuration.formFieldWrapperClassName} {f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-error')}">
<label>{field.label}
<f:if condition="{field.editor}">
<f:then>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/CrudForms/Neos/Form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- TODO This isn't adapted to Neos yet -->
<fieldset>
<f:for each="{fields}" as="field">
<div class="form-field{f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-error')}">
<div class="form-field {field.configuration.formFieldWrapperClassName} {f:validation.ifHasErrors(for: 'object.{field.property}', then: ' has-error')}">
<label>{field.label}
<f:if condition="{field.editor}">
<f:then>
Expand Down

0 comments on commit 4a130ef

Please sign in to comment.