Download the PHP package fluidtypo3/flux without Composer

On this page you can find all versions of the php package fluidtypo3/flux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flux

Flux

Coverage Status Documentation Coverage Status Performance profiling sponsored by Blackfire

Flux automates integration of Fluid with TYPO3 and makes Fluid the entry point for developers. The name "Flux" has multiple meanings but in this context, it mainly refers to the gel-like fluid used when soldering components together in electronic hardware, making it easier to create a bond between components and improves the durability of the bond.

Flux has two main purposes:

  1. Allow developers to configure TYPO3's page templates and add custom content types using Fluid templates, without the need for detailed knowledge about how TYPO3 usually requires such setup to be done.
  2. Allow embedding of metadata such as which fields to show when editing a content element, descriptions of the content or page template, and more.

Bonus feature: nested content areas to create content grids.

Documentation

How it works

Flux has two main modes of operation - either you allow Flux to automatically create a site-wide "design" folder to contain your template files, which provides a 100% out of the box experience. Or you prefer to have a more advanced and controlled integration, in which case you disable the automatic creation of site-wide template folders and provide your own (through an extension).

The automatic mode of operation is the default. This means Flux is an ideal starting point if you have zero knowledge about how to set up TYPO3. You can start with the automation and as you learn more about TYPO3, you can refine your integration and continuously improve how it works. Or keep using the automation in case it fits all your needs.

To get started you only need to know how to install a TYPO3 extension either with Composer or for non-Composer sites, using the Extension Manager.

Types of integration

Flux has multiple ways to store your page- and content templates (which are also type definitions):

  1. Fully automated through the site-wide "design" folder in the public root. This integration is easiest to use but forces your templates to render in Flux's context, and does not facilitate complex setups such as extension specific asset storage, and is not as portable as other methods - on the other hand it works immediately out of the box. Ideal for simple single-domain sites and gets you started in just a few minutes.
  2. Extension-specific, meaning you use a TYPO3 extension (written by yourself) to store all page- and content templates and additional resources such as translations, icons, and so on. This method is the most portable, meaning you can package your entire site templating in an extension that you can reuse, and is the only method which allows you to also ship PHP classes (ViewHelpers, for example) along with your site templates.
  3. For content types specifically, you can define new types using root-level database records (one per type). This method is possible to use completely without touching the file system, but has a lesser degree of portability. You can use this method to quickly create prototypes of content types using a more visual approach (through TYPO3 forms). This method also has an exporting feature which allows you to generate the necessary Fluid template that can then be used with either of the other methods.

Methods 1 and 3 are intended to get you started as quickly as possible. Method 2 is intended to serve more custom setups which ship more than just site templates, through use of a custom TYPO3 extension.

All three methods can be combined or used individually.

Composer Install

Recommended!

Non-Composer Install

NOT recommended!

  1. In the Extension Manager backend module, search for flux
  2. Choose to install the result with the extension key flux

Setup

The remaining setup of labels, form fields, grid composition etc. can all be done from within your Fluid templates.

How does it work?

When Flux is installed and enabled in extension manager, and if automatic creation of site-wide Flux templates is enabled (which it is by default), the following happens automatically:

Renaming, removing or adding files in these folders automatically registers the file as either page template or content type, depending on location. Be careful when renaming or removing files: if the page- or content template is already in use this may break your system until you choose another page template and disable/delete removed or renamed content types. There is no warning given about types that are in use!

From that point on, you can create a completely styled site with custom content types to make sliders etc. using your favorite frontend framework (or none) - and you only need to know very basic Fluid (an XML based markup engine which comes with automatically rendered documentation for every tag you can use).

What does it NOT do?

Flux does not remove the need to learn "the TYPO3 way" of doing things - you should still aim to learn more about how TYPO3 works. Flux only makes it quicker to get started and provides a reasonable level of automation; complex sites will almost surely still require you to learn a bit about TYPO3 (such as, how to modify the <meta> section and how to use third party plugins for news etc.)

Flux is also not a replacement for things like fluid_styled_content (although it can work without it) - Flux creates custom content types, it does not replace TYPO3's native content types (although you can hide those and use only your custom types).

Lastly, Flux only has limited abstraction over how you define form fields. To know all the specific details of what each type of field does, you still need to know TYPO3's "TCA" (which is thoroughly documented). Flux tries as far as possible to use the same names of form field attributes as TCA. If you don't understand an attribute or aren't sure which field type to use, always consult the TCA documentation (keeping in mind not all field types will work: Flux fields are based on FlexForm fields. When FlexForm does not support a field type it is noted so in the TCA documentation).

Recommendation of VHS

VHS is another extension in the FluidTYPO3 family, which is highly recommended to use along with Flux. The reason VHS is mentioned here, is that it provides alternatives to TypoScript-based content- and menu-rendering instructions, allowing you to instead use Fluid.

Given that in particular menu rendering setup in TypoScript is notoriously difficult (due to a very old structure which has basically never changed), beginners may prefer to use a special XHTML tag and either a few CSS class properties, or a custom loop to output menu items and their links.

Flux form API

Flux lets you build and modify forms in Fluid, which become form fields in the form that edits content/page properties through the TYPO3 backend:

Flux also lets you build a grid for content elements (nested content areas):

Flux is then capable of extracting these embedded structures to read form fields, labels, content grids, backend preview output, and more - in short, your template files embed the instructions on how to both integrate and render templates.

Alternative APIs

As you create more complex projects they usually have more complex requirements - which may still benefit from Flux features such as a way to create Flux forms for custom plugins. Since Flux works by increasingly abstracting the API of TYPO3 core features (with the Fluid "flavor" as the most condensed and abstracted) Flux also declares these increasingly flexible layers of abstraction as public API.

This means Flux also has a good old PHP way to declare forms and so on:

And supports plain arrays (to allow sources like JSON):

And can use TypoScript:

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.

Field Value Data Transformation

Flux is capable of transforming the values of fields before assigning the values as template variables. You can use this to ensure that the variables in your templates have the correct types - and you can also use it as a quick way to transform for example a selected foreign record to an instance of the domain model. Consider the following example:

When Flux renders the template that contains this form, the variable {myField} will be converted to a proper boolean.

The following transformation types are built-in:

The file etc. types will convert file references added through an IRRE FAL field to either a File or FileReference object, or an array of such objects if you use the plural forms.

You can also specify a class name of a Domain Model as the transform type. Flux will then attempt to use the matching Repository to load a single instance of that Domain Model. The value saved in the DB must be an integer uid of the related object (for example, the flux:field.relation field type will save such a value). If you need multiple instances from a multiple selection field (like flux:field.multiRelation) you must use a compound transform type like:

Or you can use a custom container class instead of ObjectStorage, for example if you have an Iterator that sorts objects in a certain way. The container class will receive an array of the domain model instances as first constructor argument.

Or you can specify any class which takes a constructor argument. Flux will then create an instance of the specified class with the database value as constructor argument. For example, using \DateTime as transform type and having a value of now in the database results in a DateTime instance with the current date+time:

Finally you can also create an implementation of FluidTYPO3\Flux\Form\Transformation\DataTransformerInterface which can support any type of data transformation:

The above class would support both transform="myexternsion:foo" and transform="myextension:bar through the same class. Obviously a DataTransformer can also support just a single type.

You can override other DataTransformers or give priority to your own DataTransformer if it supports the same type as other transformers, by returning a higher number from the getPriority method.

Special note about PHP 7.4

Since PHP 7.4 does not support attributes like PHP 8.0 and above, you'll need to manually specify a DI tag for your class, in Configuration/Services.yaml of your extension:

This is not necessary on PHP 8.0+ because the DI container will scan for the #[DataTransformer('id')] attribute and automatically tag your class as a DataTransformer for Flux.

Flux feature highlights

Caveats


All versions of flux with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4.0 || ^8
ext-json Version *
ext-pdo Version *
ext-dom Version *
typo3/cms-core Version ^10 || ^11 || ^12 || dev-master
typo3/cms-fluid Version ^10 || ^11 || ^12 || dev-master
typo3/cms-backend Version ^10 || ^11 || ^12 || dev-master
typo3/cms-frontend Version ^10 || ^11 || ^12 || dev-master
typo3/cms-recordlist Version ^10 || ^11 || ^12 || dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fluidtypo3/flux contains the following files

Loading the files please wait ....