【发布时间】:2011-05-30 07:48:01
【问题描述】:
我在两个不同的模块中有两个不同的动作,我需要在另一个模块中执行其中一个。
考虑以下行动:
//first module
class module1Actions extends sfActions {
protected function function1Form(sfWebRequest $request, sfForm $form) {
//i need to call a function from module2 in here to do sth but i don't need any view to be returned.
//but i need some variables to be returned by the second action
}
}
//second module
class module2Actions extends sfActions {
protected function executeSth(sfWebRequest $request, sfForm $form) {
//Do Something in here and return some values.
}
}
正如我所说,我需要执行一个操作并从中获取一些值,但我不知道如何调用它。它在不同的模块中。我可以访问它吗?如何?以及如何取回这些值?
谢谢。
【问题讨论】:
-
你不能。这将打破 MVC 模式。
标签: model-view-controller symfony1 action