Custom Hooks

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 “”. All callables previously registered for this hook will be invoked.

$app = new \Yee\Yee();

When you run the above code, any callables previously assigned to the hook "" 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.