Answer the question
In order to leave comments, you need to log in
Similarity of hooks in OOP for components, how to do it?
Hello!
Here in WP there is the concept of hooks, we can insert our code before doing something, so we can create our own api for some plugin and stupidly add it as we wish without changing the source code of the developer, everything rests only on the competent construction of these hooks developer, but everything is procedural, how can this be implemented in OOP? Which way to look, what to read? Thanks in advance. I am making an MVC plugin.
You can inherit, of course, and override the methods of a particular class, but then, for example, if there is a CMS, there is a component with the Foo class, I turn to the site / foo route, an object of the Foo class is created and that's it.
Help :)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question