I need symfony 1.4 action which will receive list of template names as parameter and return these rendered templates as JSONed hash. Here is the code:
foreach ($templateNames as $templateName)
$result[$templateName] = $this->getController()->getPresentationFor($this->getModuleName(), $this->getActionName(), $templateName);
The code causes "Too many forwards have been detected for this request." exception to be thrown. I assume that this is because getPresentationFor creates internal request to same module and action. So the question is how can I achieve my goal and get several templates rendered and returned?
PS: I am working with existing system so I cannot use partials or components but templates only.