You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your example show how to modifiy the arguments before executing the original method ("hookBefore").
But would it possible to replace /stop the execution of the original method? Example from a cms I know.
// $event is the current object with all additional features of the cms like "global" variables, ...
$event->replace = true; // do not execute the original method after the hook finishes
Or "hookAfter" original method is executed to manipulate the output?
$event->return = $value; // manipulate or replace the return value of the original method
The text was updated successfully, but these errors were encountered:
Sorry, hookBefore / hookAfter works as should. Interesting part is how to replace a original method.
If the hooks / methods executed in a loop the return value or a property could be checked to break / skip the loop?
Your example show how to modifiy the arguments before executing the original method ("hookBefore").
But would it possible to replace /stop the execution of the original method? Example from a cms I know.
Or "hookAfter" original method is executed to manipulate the output?
The text was updated successfully, but these errors were encountered: