Home >Backend Development >PHP Tutorial >How does codeigniter implement the hook mechanism?
How does codeigniter implement the hook mechanism? , friends in need can refer to it. I remember the last time I went to Xila for an interview, the interviewer asked me a question: How does codeigniter implement the hook mechanism? Attached is the source code of codeigniter’s hooks class:
可以看出codeigniter实现钩子机制的方式不够优雅,其实完全可以使用观察者模式来实现钩子机制,将挂载点当做监听的事件。 |