Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Bastian Waidelich bwaidelich

🏠
Working from home
Block or report user

Report or block bwaidelich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bwaidelich
bwaidelich / ExampleEvent.php
Created Jun 1, 2017
Flow EventSourcing: Use Value Objects as Event Payload / ReadModel primary keys
View ExampleEvent.php
<?php
namespace Some\Package
use Neos\EventSourcing\Event\EventInterface;
final class ExampleEvent implements EventInterface
{
/**
* @var UserId
*/
@bwaidelich
bwaidelich / FacetViewHelper.php
Created Mar 31, 2017
Simple ViewHelper to create facet filter links (without filling up the Routing Cache) Raw
View FacetViewHelper.php
<?php
namespace Wwwision\Test\ViewHelpers\Link;
use Neos\FluidAdaptor\Core\ViewHelper\AbstractTagBasedViewHelper;
use Neos\FluidAdaptor\Core\ViewHelper;
/**
* Simple ViewHelper to create facet filter links
*
* Usage:
@bwaidelich
bwaidelich / SimpleTemplateView.php
Created Oct 20, 2016
Very simple Template View for Neos Flow
View SimpleTemplateView.php
<?php
namespace Some\Package\View;
use TYPO3\Flow\Mvc\View\AbstractView;
use TYPO3\Flow\Reflection\ObjectAccess;
class SimpleTemplateView extends AbstractView
{
/**
* @var array
@bwaidelich
bwaidelich / ActionIfGrantedViewHelper.php
Created Jun 15, 2016
A simple Neos Flow ViewHelper that only renders an action link if the target action is granted by the currently authenticated account. Otherwise it will only render the link text
View ActionIfGrantedViewHelper.php
<?php
namespace Your\Package\ViewHelpers\Link;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Aop\JoinPoint;
use TYPO3\Flow\Mvc\ActionRequest;
use TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilegeInterface;
use TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilegeSubject;
use TYPO3\Flow\Security\Authorization\PrivilegeManagerInterface;
use TYPO3\Fluid\ViewHelpers\Link\ActionViewHelper;
@bwaidelich
bwaidelich / DetectSubdomainComponent.php
Created May 6, 2016
Tamper Routing MatchResults from a Flow HTTP Component
View DetectSubdomainComponent.php
<?php
namespace Your\Package;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Component\ComponentContext;
use TYPO3\Flow\Http\Component\ComponentInterface;
use TYPO3\Flow\Mvc\Routing\RoutingComponent;
use TYPO3\Flow\Utility\Arrays;
class DetectSubdomainComponent implements ComponentInterface
@bwaidelich
bwaidelich / Index.html
Created Apr 30, 2016
Upload multiple resources in Neos Flow
View Index.html
<f:form action="upload" enctype="multipart/form-data">
<f:form.upload name="resources[]" additionalAttributes="{multiple: true}" />
<f:form.submit value="Upload new resources"/>
</f:form>
@bwaidelich
bwaidelich / Jwt.php
Last active Feb 22, 2019
External authentication with Neos Flow and local JWT (http://jwt.io/) as cache
View Jwt.php
<?php
declare(strict_types=1);
namespace Your\Package\Security\Authentication;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\ActionRequest;
use Neos\Flow\Security\Authentication\Token\AbstractToken;
use Neos\Flow\Security\Authentication\Token\SessionlessTokenInterface;
/**
@bwaidelich
bwaidelich / Routes.CRUD.yaml
Created Jan 26, 2016
Example for reusable REST/CRUD sub routes (For the Flow application framework)
View Routes.CRUD.yaml
-
name: 'NewAction'
uriPattern: 'new'
defaults:
'@action': 'new'
httpMethods: [GET]
-
name: 'CreateAction'
uriPattern: 'create'
@bwaidelich
bwaidelich / Settings.yaml
Created Oct 30, 2015
Using HTTP Basic Authentication in TYPO3 Flow
View Settings.yaml
TYPO3:
Flow:
security:
authentication:
providers:
'HttpBasicProvider':
provider: 'PersistedUsernamePasswordProvider'
token: 'TYPO3\Flow\Security\Authentication\Token\UsernamePasswordHttpBasic'
entryPoint: 'HttpBasic'
@bwaidelich
bwaidelich / PurifyViewHelper.php
Created Jul 20, 2015
Fluid ViewHelper integrating HTMLPurifier to sanitize/tidy HTML output
View PurifyViewHelper.php
<?php
namespace Your\Package\ViewHelpers\Format;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* ViewHelper rendering the given HTML string through HTMLPurifier
*/
class PurifyViewHelper extends AbstractViewHelper {
You can’t perform that action at this time.