duangongqiong6958 2011-03-07 22:33
浏览 58
已采纳

Drupal 6:为不同的模块提供自定义功能

I have a couple of custom PHP functions that I would like to make available to several modules I created.

What would be the drupal-correct way to get around this problem? Basically, I would like to avoid copying all those functions inside every module I have.

  • 写回答

1条回答 默认 最新

  • dousao2186 2011-03-07 22:41
    关注

    Well, you can't just copy the functions into every module because if you have two or more modules with those functions then you'll get PHP errors about the function already having been declared (unless you go through the effort of renaming them in each module).

    The best way to go about it depends on your exact usage, but assuming they are a collection of related core or api functionality, then I would place these into a separate module and then any additional modules could have the core module as a dependency.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码