Skip to content

Instantly share code, notes, and snippets.

View bmoex's full-sized avatar

Benjamin Serfhos bmoex

View GitHub Profile
@bmoex
bmoex / AGENTS.md
Created February 4, 2026 17:18
DDEV local development guidelines

DDEV local development

  • This project runs inside DDEV Docker containers. You MUST execute all commands through DDEV.
  • Check if a ddev executable is actually available with ddev --version.
  • Validate if a service is running with ddev describe.
  • Start services using ddev start and stop them with ddev stop.
  • Open the application in the browser by running ddev launch [path, ex: /login].
    • Always prefix PHP, Artisan, Composer, and Node commands with ddev. Examples:
    • Run Artisan Commands: ddev artisan
  • Install Composer packages: ddev composer install
@bmoex
bmoex / TitleTagViewHelper.php
Last active September 11, 2019 09:01
The PageTitle API of TYPO3 CMS: how to use it in a ViewHelper?
<?php
namespace My\Extension\ViewHelpers;
use Closure;
use My\Extension\PageTitle\ViewHelperPageTitleProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@bmoex
bmoex / MenuProcessor.php
Created April 11, 2019 09:32
MenuProcessor that handle shortcuts for active/inactive state
<?php
namespace Your\Namespace\DataProcessing;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Page\PageRepository;
/**
* Data Processor: Menu Processor
* Correctly define menu states for all possible types
@bmoex
bmoex / StoreInUrlCacheHook.php
Created April 25, 2018 10:57
Extend RealURL to store cHash when not already calculated
<?php
namespace Serfhos\RealurlCacheHashGeneration\Cache;
use DmitryDulepov\Realurl\Cache\UrlCacheEntry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
/**
* RealURL Hook: StoreInUrlCache
@bmoex
bmoex / MailFormDataUpdate.php
Last active April 26, 2019 10:48
Migration from "old" mailforms to "new" form extension
<?php
// Location: EXT:yourextension/Classes/Install/Updates/MailFormDataUpdate.php
namespace Serfhos\OldMailMigration\Install\Updates;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MailUtility;
/**
* Migrate "mailform" data to new 7.6 ext:form