Custom hooks may be created and invoked in a Yee application. When a custom hook is invoked with
applyHook(), it will invoke all callables assigned to that hook. This is exactly how the Yee application’s default hooks work. In this example, we apply a custom hook called “my.hook.name”. All callables previously registered for this hook will be invoked.
<?php $app = new \Yee\Yee(); $app->applyHook('my.hook.name');
When you run the above code, any callables previously assigned to the hook "my.hook.name" will be invoked in order of priority (ascending).
You should register callables to a hook before the hook is applied. Think of it this way: when you invoke the Yee application’s
applyHook() method, you are asking Yee to invoke all callables already registered for that hook name.