hookBefore, hookAfter and replace original method? #3
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sciactive/hookphp#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?
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?