TYPO3 Glossary

Hooks in TYPO3 – Glossary

TYPO3 Hooks

TYPO3 hooks are like special places in TYPO3 where you can insert your own code to change the way things work. Imagine personalizing a recipe and adding your own ingredients at certain steps. Hooks allow you to do something similar with TYPO3 - you can add your own features or change existing ones without changing the core code. This helps you personalize and extend TYPO3 to meet your needs.

Hooks are entry points in the TYPO3 core at which developers can attach their own code to change the system’s behaviour without touching the core. They enable adjustments when saving records, when rendering pages or when processing requests.

The principle is simple: the core calls registered functions at defined places. Those who develop an extension register their class for the suitable hook and execute additional logic there, such as adding data, checking input or sending notifications.

In newer versions many hooks are replaced by events and PSR-14 events. These offer a clearly defined interface, better testability and support through dependency injection. Existing hooks should be reviewed during upgrades and, where possible, replaced with events.

Hooks are suitable when standard functions are not enough but a complete overriding of classes is not necessary. They keep adjustments separate from the core and make updates easier. Still: use them sparingly and document which hooks are used.

Pay attention to order and interactions. Several extensions can use the same hook, causing processes to overlap. Tests help to recognise unexpected effects.

Security and performance are also important: code in hooks often runs on every request and should stay lean.

Those starting out read the documentation on events and check whether a suitable entry point already exists there.

We develop adjustments with hooks and events that are clean, maintainable and update-capable.

Contact us for individual requirements.

In short: Understanding and Utilizing TYPO3 Hooks.