Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
<?php
namespace TYPO3\Neos\Taxonomy\Controller\Module\Management;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Taxonomy". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
@mneuhaus
mneuhaus / 1_Lifecycle.md
Last active August 29, 2015 14:03
Expose Usecases

Object Lifecycle

Initialize Object

As a developer i might need to initialize a object before it is used to render a form.

This would be possible to do by overriding the default 'newAction' like this:

MyController.php

/**
@mneuhaus
mneuhaus / Foo.md
Last active August 29, 2015 14:04
Extending existing Models/Classes

Flow builds for most classes a proxy for Dependency injection, lazy loading, etc it does this by creating a new file in the Code Cache that contains the contents of the original class appended with the suffix "_Original" and a class with the name of the real className that inherits from that, in this class is some magic for dependency injection, aop and lazy loading. For example:

Given we have a class named \My\Package\Foo
Then Flow will create a file called My_Package_Foo.php
This file contains the code of the class "\My\Package\Foo" with a className suffix "_Original" -> \My\Package\Foo_Original
@mneuhaus
mneuhaus / Harvest.md
Last active August 29, 2015 14:04
Harvest Mac App
  1. In the Timesheet window the Right/Left Arrows should switch between the previous/next days
  2. When opening the timesheet window the currently running timer should be focused in order to quickly stop it with "s"
  3. When you start a timer based on an existing timer of a previous day, that timer should be on the current day, not in the past
@mneuhaus
mneuhaus / Settings.yaml
Created August 5, 2014 14:36
Doctrine/Flow Tenancy Behavior
TYPO3:
Flow:
persistence:
doctrine:
filters:
'SoftDeleteableFilter': 'Famelo\Saas\Domain\Filter\TenancyFilter'
eventListeners:
-
events: ['onFlush']
listener: 'Famelo\Saas\Domain\Listener\TenancyListen
@mneuhaus
mneuhaus / Example.php
Created August 5, 2014 15:08
GenerateValueListener
<?php
namespace Famelo\Saas\Domain\Model;
use Doctrine\ORM\Mapping as ORM;
use TYPO3\Flow\Annotations as Flow;
/**
* @Flow\Entity
*/
class Example {
/**
<?php
class...{
/**
* @Flow\Inject(setting="tagAttributes", package="TYPO3.Fluid")
* @var array
*/
property $tagAttributes;

This gist is a collection of classes and configurations that enable to have an entity as a "persistent" context in multiple controllers.

  • ClientRoutePartHandler.php + Routes.yaml: these to handle the conversion of the route
  • ClientContextAware.php: identifies a controller to be ClientContextAware
  • ClientArgumentAspect.php: checks if the current controller ist ClientContextAware and adds the argument client to any url that is build without manual intervention
  • ClientContext.php: fetches the current client as a context, you can inject this class into anything where you might need the client to work with inside a ClientContextAware Controllercall.
  • Package.php: Injects the current Request into the ClientContext

Example

@ci-stepper-height: 40px;
@ci-stepper-arrow-width: 20px;
@ci-stepper-arrow-width-mobile: 10px;
@ci-stepper-padding: 20px;
@ci-stepper-mobile-active-width: 0.6;
@ci-staged-stepper-height: 58px;
.ci-make-nav-stepper(@columns) {
margin: 0 0;
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="grid3" options="{useTypoScript: 0}" label="Grid: 50-50">
<flux:grid>
<flux:grid.row>
<flux:grid.column style="width: 50%;border-right: 1px dotted #999;" name="column1" label="Spalte 1" />