Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 CodeIgniter 中的某些函数调用之前调用某个事件 [events]?!从我读到的关于钩子的内容中......它们看起来很好,但它们是在调用整个控制器之前/之后执行的。我正在寻找类似的东西,但在功能级别而不是控制器级别。
不。
钩子是应用程序中的预定义点,允许您在该点执行某些操作。
Hooks 无法知道你将要运行或已经运行的函数——你需要自己告诉应用程序。无论是在函数中还是在自己调用函数之前/之后。