Skip to content

Instantly share code, notes, and snippets.

View fnagel's full-sized avatar

Felix Nagel fnagel

View GitHub Profile
@Neunerlei
Neunerlei / php-cs-fixer-as-tool
Last active May 25, 2020 12:46
PHP-CS-Fixer in PHP-Storm
As an "External Tool"
----------------------
Settings -> Tools -> External Tools
Create a new Tool called "CS-Fixer"
Program: Select your Docker executable
Arguments: run --rm -v $FilePath$:/$FileName$ cytopia/php-cs-fixer fix --rules=@PSR2 /$FileName$
OK -> Done
As a "File Watcher"
@YannickFricke
YannickFricke / semantic_ui_form_theme.html.twig
Last active March 22, 2023 22:57
Form theme for symfony for semantic ui
{%- block form_start -%}
{%- do form.setMethodRendered() -%}
{% set method = method|upper %}
{%- if method in ["GET", "POST"] -%}
{% set form_method = method %}
{%- else -%}
{% set form_method = "POST" %}
{%- endif -%}
{% if attr.class is defined %}
@peterkraume
peterkraume / Page.ts
Created July 20, 2017 09:51
Backport for TYPO3 8.7: PageLayoutView - Allow to disable copy- / translate- buttons
mod {
web_layout {
// disable translation mode for content elements
// backported feature from TYPO3 9.x. See Xclass PageLayoutView.php for details
localization.enableTranslate = 0
}
}
@smichaelsen
smichaelsen / QueryResult.php
Created November 12, 2015 08:19
Extend extbase QueryResult to fix count() of queries with a custom $statement
<?php
namespace AppZap\Tripshop\Persistence;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement;
class QueryResult extends \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
{
/**
* Overwrites the original implementation of Extbase
*
@wouterds
wouterds / convert-mapstylejson-to-urlargs.php
Created January 27, 2015 14:42
Convert google maps style json to url arguments to use for google maps static images.
<?php
public function mapStylesUrlArgs($mapStyleJson)
{
$params = [];
foreach (json_decode($mapStyleJson, true) as $style) {
$styleString = '';
if (isset($style['stylers']) && count($style['stylers']) > 0) {
@dmitryd
dmitryd / Typo3DbQueryParser.php
Last active September 7, 2017 07:35
Fix issue with incorrect localization handling in Extbase (missing support for l10n_mode=exclude, which makes some relations missing). See http://bit.ly/1Djw1CV
<?php
namespace DmitryDulepov\Sample\Xclass;
class Typo3DbQueryParser extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser {
/**
* Fixes incorrect localisation handling in Extbase.
*
* @param string $tableName
* @param array $sql
@cedricziel
cedricziel / README.md
Last active October 27, 2021 08:12
TYPO3 Extension with 3rd part composer dependencies. composer.json is placed in Resources/Private - Updated

Motivation

As long as composer support in CMS is "not there yet", you need to get around somehow.

Say you want to use the (awesome) markdown library, you need a way to get it in.

How

  1. Use a container extension with a private namespace
@helhum
helhum / PersistentObjectConverter.php
Last active January 24, 2021 14:08
Extbase TypeConverter to fetch hidden records from persistence (Using this will *always* fetch hidden models of the specified type)
<?php
namespace MyVendor\MyExtension\Property\TypeConverters
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter
class MyPersistentObjectConverter extends PersistentObjectConverter {
/**
* @var string
*/