tastaturberuf/contao-interfaces

1.0 2021-04-07 15:10 UTC

This package is auto-updated.

Last update: 2024-09-15 18:49:42 UTC


README

这个库可以帮助您始终获取所有钩子和回调的正确参数。这个集合仅包含接口类。

所有钩子都以Hook结尾,所有回调都以Callback结尾。

Contao钩子参考

Contao回调参考

易于使用

use Tastaturberuf\ContaoInterfaces\Hooks\LoadDataContainerHook;

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

仍然使用注解

如何在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
    }
}

如果您有任何问题,请随时贡献或提交一个问题。