Skip to content

This library helps you to always get the right parameters for all hooks and callbacks.

License

Notifications You must be signed in to change notification settings

Tastaturberuf/contao-interfaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contao Interfaces

This library helps you to always get the right parameters for all hooks and callbacks. This collection consists of interface classes only.

All hooks are suffixed with Hook and all Callbacks with Callback.

Contao Hook reference

Contao Callback reference

Simple to use

use Tastaturberuf\ContaoInterfaces\Hooks\LoadDataContainerHook;

class MyEventListener implements LoadDataContainerHook
{
    public function onLoadDataContainer(string $table) : void
    {        
        // Do something
    }
}

Still use annotations

How to use annotations in Contao

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Tastaturberuf\ContaoInterfaces\Hooks\LoadDataContainerHook;
use Terminal42\ServiceAnnotationBundle\ServiceAnnotationInterface;

class MyEventListener implements LoadDataContainerHook, ServiceAnnotationInterface
{
    /**
     * @Hook("loadDataContainer", priority=1337)
     */
    public function onLoadDataContainer(string $table) : void
    {        
        // Do something
    }
}

Feel free to contribute or make an issue if you have problems.

About

This library helps you to always get the right parameters for all hooks and callbacks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages