Adding event handlers to extension modules - Printable Version +- CoreBOSBB (https://discussions.corebos.org) +-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18) +--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4) +--- Thread: Adding event handlers to extension modules (/showthread.php?tid=523) |
Adding event handlers to extension modules - Guido1982 - 12-13-2016 I was reading the vtlib docs and came accross this code: Code: <?xml version="1.0" encoding=”utf-8”?> Where I see you can add event handlers in the manifest file of an extension module. But we could just as easily do it in the vtlib_handler class method of the main file right? So in modules/MyModuleName/MyModuleName.php I would create: PHP Code: function vtlib_handler($modulename, $event_type) { Where I would do the event handler creation in the postinstall? RE: Adding event handlers to extension modules - joebordes - 12-13-2016 Creating the event handler in the manifest file is equivalent to creating it in the vtlib_handler postinstall section. The manifest file gets executed on install of the module/extension and then the vtlib_handler postinstall section is invoked. So they are basically the same. The big difference is that vtlib_handler you can execute any code you want. RE: Adding event handlers to extension modules - Guido1982 - 12-13-2016 Great, thanks. That's what I thought but nice to know for sure. |