hn / formsave
Saves data of ext:form in a usable state
v1.6.3
2020-03-09 09:10 UTC
Requires
- php: ~7.1
- phpoffice/phpspreadsheet: ^1.4
- typo3/cms-core: ~8.7.7
- typo3/cms-extbase: ~8.7.7
- typo3/cms-form: ~8.7.7
Requires (Dev)
- nimut/testing-framework: ^4.0
- typo3/cms-composer-installers: >=1.4
Replaces
- typo3-ter/formsave: v1.6.3
This package is auto-updated.
Last update: 2024-12-16 13:03:27 UTC
README
This extension allow to easily create domain models from form data.
basic usage
- install using
composer require hn/formsave
- create a form and add the Formsave finisher, select Generic as intent
- optionally add identifier to each field
advanced usage
You can add own intents which also creates own domain objects. Lets go with an exampe of an "Application".
Create a domain model class Vendor\Extension\Domain\Model\Application
<?php
namespace Vendor\Extension\Domain\Model;
use Hn\Formsave\Domain\Model\Document;
class Application extends Document
{
}
Implement extbase inheritence
Use the ext_typoscript_setup.txt
for that.
config.tx_extbase.persistence.classes {
Hn\Formsave\Domain\Model\Document {
subclasses {
Vendor\Extension\Domain\Model\Application = Vendor\Extension\Domain\Model\Application
}
}
Vendor\Extension\Domain\Model\Application {
mapping {
recordType = Vendor\Extension\Domain\Model\Application
tableName = tx_formsave_domain_model_document
}
}
}
Extend the select fields in the form editor and in TCA
// Configuration/TCA/Overrides/tx_formsave_domain_model_document.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tx_formsave_domain_model_document', 'type', [
'Application',
\Vendor\Extension\Domain\Model\Application::class,
]);
# Configuration/Form/FormEngineSetup.yaml
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
formEditor:
propertyCollections:
finishers:
1531314970:
editors:
110:
selectOptions:
1531319170:
value: 'Vendor\Extension\Domain\Model\Application'
label: 'Application'
Add Behavior to your formdata
Look into Hn\Formsave\Domain\Finisher\FormsaveFinisher
.
There are a few signals in which you can change the behavior.
One example would be to send an email when a user applies.