【问题标题】:How to add weight on hook_form_alter如何在 hook_form_alter 上添加权重
【发布时间】:2011-11-04 19:03:34
【问题描述】:

我的模块中有一个 hook_form_alter,但另一个模块 workbench_access 也有一个 hook_form_alter,我需要在 hook_form_alter 之前调用它。如何增加我的 hook_form_alter 的重量?

【问题讨论】:

    标签: php drupal drupal-7 drupal-modules drupal-hooks


    【解决方案1】:

    您只需将system 表中您的模块的weight 列设置为高于Workbench Access 模块的列。

    请参阅How to update a module's weight 了解执行此操作的不同方法。完成后,清除 Drupal 的缓存,您的模块的钩子将在 Workbench Access 模块(很可能还有很多其他模块)之后调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-20
      • 2022-11-07
      相关资源
      最近更新 更多