我在两个不同的模块中有两个不同的动作,我需要在另一个模块中执行其中的一个。symfony - 从另一个动作调用动作
考虑采取以下行动:
//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模式。 – Flukey 2011-05-30 08:20:56