GithubHelp home page GithubHelp logo

extrameile / em_form_repeatablesave Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 24 KB

TYPO3 EXT:form save to database finisher for repeatable data

License: GNU General Public License v2.0

PHP 100.00%
typo3 typo3-cms-extension typo3-form

em_form_repeatablesave's Introduction

Custom form finisher "SaveRepeatableToDatabase"

TYPO3 EXT:form save to database finisher for repeatable data

The TYPO3 extension allows to save repeatable data into database tables like the SaveToDatabaseFinisher from core. To create forms with repeatable data in TYPO3 v8 LTS, you can use the repeatable_form_elements extension from TRITUM https://github.com/tritum/repeatable_form_elements

Usage

The finisher is used like the SaveToDatabase finisher from TYPO3 Core. It only introduce a new option called "repeat", if it isn't set, the core code path is used. If you set it to the identifier of a repeating container it will use this one to save data repeatingly to the table.

Example

finishers:
  -
    options:
      -
        table: fe_users
        mode: insert
        databaseColumnMappings:
          pid:
            value: '1'
          crdate:
            value: '{__currentTimestamp}'
          tstamp:
            value: '{__currentTimestamp}'
          tx_extbase_type:
            value: Tx_Extbase_Domain_Model_FrontendUser
        elements:
          username:
            mapOnDatabaseColumn: username
          email:
            mapOnDatabaseColumn: email
      -
        table: fe_users_locations
        mode: insert
        repeat: locationcontainer
        databaseColumnMappings:
          pid:
            value: '1'
          crdate:
            value: '{__currentTimestamp}'
          tstamp:
            value: '{__currentTimestamp}'
          fe_user:
            value: '{SaveRepeatableToDatabase.insertedUids.1}'
        elements:
          locationstreet:
            mapOnDatabaseColumn: street
          locationplace:
            mapOnDatabaseColumn: place
          locationzip:
            mapOnDatabaseColumn: zip
          locationcity:
            mapOnDatabaseColumn: city
      -
        table: fe_users
        mode: update
        whereClause:
          uid: '{SaveRepeatableToDatabase.insertedUids.0}'
        databaseColumnMappings:
          locations:
            value: '{SaveRepeatableToDatabase.countInserts.1}'
    identifier: SaveRepeatableToDatabase

Hint

This implementation won't work with nested repeatable form elements.

em_form_repeatablesave's People

Contributors

opi99 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ecogabe

em_form_repeatablesave's Issues

Two Questions

What is the reason for the check whether a mapped value is a string here? If that is executed I can't use the special value '{__currentTimestamp}' (among others)... (I used the fork of @EcoGabe but the affected lines are the same.)

Is there a way to evaluate the WHERE clause using values from within a repeatable container?

Can you explain more?

Hello!

Sorry! I do not fully understand, what makes this extension and for what it?

Can you explain more about your extension?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.