在 redmine 的二次开发中无论在 controller 层还是 view 层、model 层,总能看到 call_hook 这个方法,在网上查它的意思也没有查到,并且不知道为什么要用它,何时用它,请各位帮忙讲解一下。谢谢~
controller 中
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
model 中
Redmine::Hook.call_hook(:model_project_copy_before_save, :source_project => project, :destination_project => self)
view 中
<%= call_hook(:view_projects_form, :project => @project, :form => f) %>