Skip to content

Instantly share code, notes, and snippets.

@mneuhaus
Last active August 29, 2015 14:07
Show Gist options
  • Save mneuhaus/f7236089c031be85feb3 to your computer and use it in GitHub Desktop.
Save mneuhaus/f7236089c031be85feb3 to your computer and use it in GitHub Desktop.
Famelo.Soul: a flexible controller flow with a persistent state for TYPO3.Flow

Combinations of Controllers/Actions that span wider than 2-3 Actions are simple to code, but often result in extremely rigid and unflexible structures that are not easily extendable or modularized. The biggest example is for example a User Registration, this kind of process varies quite extremely in any kind of project. Some times it's enough to have a simple form + e-mail verification, sometimes you need a quite complex process with verification, invoicing, reviewing, etc. Currently it's often necessary to reimplement various of this things from the ground up.

I've been toying with a basic concept for a while in my head which could be shortly described as combination of controllers/actions that are tied together by conditions through a settings.yaml which share and manipulate a state that's automatically persisted.

###Terminology

Soul: The Soul is an entity containing the current state of the process Fragment: a Fragment is Transition: a Transition defines what should be done next, if the givin eel conditions based on the soul is true

Example of a complex registration for a saas:

'registration':
  soul: '\Famelo\Saas\Domain\Model\InviteRequest'
  fragments:

    InviteRequest:
      controller: '\Famelo\Soul\Controller\InvitationRequestController'
      action: 'index'
      transitions:
        EmailVerification: 'true'

    EmailVerification:
      controller: '\Famelo\Soul\Controller\EmailVerificationController'
      action: 'index'

Routing

[soul]/[fragment]/[token]
[fragment]/[action]/[token]
[token]/[action]
[package]/[controller]/[action]?__soul=[token]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment