Git Product home page Git Product logo

formit2db's Introduction

FormIt2db/db2FormIt

FormIt hooks for saving/retreiving xPDO objects.

Features:

FormIt2db/db2FormIt are two small snippets to save xPDO objects during FormIt posts and retreive them before displaying FormIt forms.

Installation:

MODX Package Management

The xPDO models could be also generated by i.e. MIGX or CMPGenerator.

Usage

Snippet Properties for FormIt2db

Property Description Default
prefix Table prefix of the xPDO package MODX DB prefix
packagename Package name of the xPDO object -
classname Class name of the xPDO object -
tablename Table name of the autocreated xPDO Package -
where JSON encoded xPDO where clause - to update a row instead of creating a new one -
paramname Requested POST param - to update a row instead of creating a new one -
fieldname xPDO fieldname the POST param is compared with - to update a row instead of creating a new one 'paramname'
arrayFormat Format to transform form fields that contains array data (i.e. checkboxes) into csv
arrayFields JSON encoded array of form fields that contains array data []
removeFields JSON encoded array of form fields not saved in the xPDO object []
autoPackage Use the autocreated xPDO Package false

Snippet Properties for db2FormIt

Property Description Default
prefix Table prefix of the xPDO package. MODX DB prefix
packagename Package name of the xPDO object. -
classname Class name of the xPDO object. -
where JSON encoded xPDO where clause - to retreive an existing row. -
paramname Requested REQUEST param - to retreive an existing row. -
fieldname xPDO fieldname the REQUEST param is compared with - to retreive an existing row. 'paramname'
arrayFormat Format to transform database fields that contains array data (i.e. checkboxes) into csv
arrayFields JSON encoded array of database fields that are transformed into arrays []
ignoreFields JSON encoded array of database fields that are not retreived into FormIt []
notFoundRedirect ID of the MODX resource the user is redirected to, if the requested row is not found 0
autoPackage Autocreate the xPDO Package with packagename and tablename false

Notes

  1. The snippets bases on the code in the following thread in MODX forum http://forums.modx.com/thread/?thread=32560
  2. If the xPDO package is autocreated, the classname in the package is generated by MODX and could be different to a classname set by parameter. If you disable the autoPackage parameter later, please look which classname was generated and change the parameter to that value.

formit2db's People

Contributors

jako avatar

Watchers

nico avatar

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.