Giter Club home page Giter Club logo

flux's Introduction

Flux: Fluid FlexForms

Build Status Coverage Status Documentation Build Status Coverage Status

Flux is a replacement API for TYPO3 FlexForms - with interfaces for Fluid, PHP and TypoScript

Flux lets you build and modify forms in Fluid:

<flux:form id="myform">
  <flux:field.input name="myField" label="My special field" />
</flux:form>

In PHP:

$form = \FluidTYPO3\Flux\Form::create();
$form->setName('myform');
$form->createField('Input', 'myField', 'My special field');

In plain arrays (to allow sources like JSON):

$json = '{name: "myform", fields: [{"name": "myField", "type": "Input"}]}';
$asArray = json_decode($json, JSON_OBJECT_AS_ARRAY);
$form = \FluidTYPO3\Flux\Form::create($asArray);

And in TypoScript:

plugin.tx_flux.providers {
  myextension_myplugin {
    tableName = tt_content
    fieldName = pi_flexform
    listType = myextension_myplugin
    extensionKey = Vendor.MyPlugin
    form {
      name = myform
      fields {
        myField {
          type = Input
          label = My special field
        }
      }
    }
  }
}

All of which create the same form with a single input field called myField with a label value of My special field. The last example shows the form structure nested in a Provider (another Flux concept) which connects the pi_flexform field of the related tt_content plugin record type to the form.

Flux feature highlights

  • Added features for content elements - add content grids (following the backend_layout approach) to any content/plugin.
  • Multiple APIs to access the same features from many different contexts using the same naming and nesting style.
  • Multiple levels of API abstraction - when you need more control, lower API abstraction levels can be used in your code.
  • Flexible ways to replace individual parts: templates, controller actions, etc.
  • Manipulation of properties of existing forms - change field labels, default values, add fields, sheets, etc.
  • Data type transformations - define the desired target type and let the TypeConverters of Extbase handle conversion.
  • Possibility for custom components of your own - with the same API support any other Flux component has.
  • Several Utility-type classes for advanced integrations with Fluid in particular.

Known issues

  • Keep In mind to have your PHP/HTTP configured correctly to accept a fairly large number of input fields. When nesting sections / objects the number of fields submitted, rises drastically. The php.ini configuration setting to think about is max_input_vars. If this number is too small then the TYPO3 Backend (being PHP) will decline the submission of the backend editing form and will exit with an "Invalid CSRF Token" message because of incomplete (truncated) POST data.

Documentation

flux's People

Contributors

namelesscoder avatar bjo3rnf avatar cedricziel avatar coding46 avatar monosize avatar xf- avatar jmverges avatar cweiske avatar galoppi avatar fabarea avatar benjaminbeck avatar higidi avatar pixelmatseriks avatar x3ro avatar pixelbrackets avatar pkerling avatar bmack avatar tiggr avatar romm avatar torvitas avatar amkoroew avatar neufeind avatar tpinne avatar ste101 avatar wouter90 avatar dakmor avatar dogawaf avatar akii avatar joneppie avatar jsegars avatar

Watchers

Steffen Kamper 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.