Can you Control the Order of Hooks “Firing” in Drupal?

我是研究僧i 提交于 2019-12-11 00:45:56

问题


If two modules implement the same hook in Drupal, does the system have a way to define which order the hook functions are called, or is it just luck of the draw/alphabetical ordering? Or something else? Or does my question show I misunderstand hooks in some fundamental way that makes me look dumb?


回答1:


The order is determined based on the weight setting for the module in the system table. If two modules have the same weight, the order is alphabetical.




回答2:


Take a look at module weight in database, or use http://drupal.org/project/moduleweight



来源:https://stackoverflow.com/questions/4994579/can-you-control-the-order-of-hooks-firing-in-drupal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!