spooner-web / fluid-form-elements
Easy to use fluid form elements for Extbase/Fluid usage
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- php: ^7.0 || ^7.1
- typo3/cms-core: ^8.7
- typo3/cms-extbase: *
- typo3/cms-fluid: *
Requires (Dev)
- phpunit/phpunit: ^5.6
This package is auto-updated.
Last update: 2024-10-15 00:21:06 UTC
README
This is a TYPO3 extension which simplifies the usage of the Fluid form view helpers.
Installation
composer require spooner-web/fluid-form-elements
Why using these view helpers?
Are you tired of collecting the same records for your select again and again?
Do you manage your labels for BE and FE twice?
Do you copy/paste your template around the form elements?
Now these times are over. With Fluid Form Elements you:
- can set your own template wrapping the form elements
- can use the built-in Bootstrap templates (default and horizontal)
- get all records by the repository for your select automatically (based on the given property)
- get the label determined automatically on the general label
tablename.fieldname
- can set the Bootstrap grid classes to use in horizontal form (default is col-sm-3/col-sm-9)
Usage
After installation, the extension uses the namespace ffe
globally.
You are able to set the wanted template (currently default and horizontal Bootstrap form) in the extension configuration.
Then you can start directly in your extension by using the new view helpers.
Examples of usage
- By using the textfield view helper
<ffe:form.textfield property="name" />
you get the Bootstrap template
or horizontal Bootstrap (v4)div class="form-group"> <label for="<!-- the property path, uses as ID -->"><!-- the determined label --></label> <!-- the rendered textfield by the original Fluid view helper --> </div>
<ffe:form classLabelColumn="col-sm-4" classFieldColumn="col-sm-8"> <div class="form-group row"> <label class="col-form-label <!-- given column bootstrap label class, set in <ffe:form />, default "col-sm-3" -->" for="<!-- the property path, uses as ID -->"><!-- the determined label --></label> <div class="<!-- given column bootstrap field class, set in <ffe:form />, default "col-sm-9" -->"> <!-- the rendered textfield by the original Fluid view helper --> </div> </div> </ffe:form>
- By using the select view helper
<ffe:form.select property="country" />
it determines what is given in your model behind the propertycountry
. If there is a relation to another model, it looks for the related repository and callsfindAll()
to get all records. - You can override arguments by using them, e.g.
<ffe:form.select property="country" objects="{countries}" />
and you can fill the select with your own data. - By using the argument
label
you can use your own label, e.g.<ffe:form.textarea property="description" label="My description" />
Usable view helper
- FormViewHelper
- TextfieldViewHelper
- TextareaViewHelper
- SelectViewHelper
- CheckboxViewHelper
- RadioViewHelper