I'd like to set a variable in my Symfony action that holds the rendered template data for that action. I'm returning some JSON content with the action, and I'd like to store what the action would be outputting into the JSON and return it.
public function executeAjaxPriceAdditionCreate(sfWebRequest $request)
{
$this->form = new ProductPriceAdditionAjaxForm();
$json['success'] = $this->processAjaxPriceAdditionForm($request, $this->form);
$this->setTemplate('ajaxPriceAdditionNew');
$json['content'] = ???; // THIS IS WHERE THE RENDERED TEMPLATE CONTENT SHOULD GO.
$this->getResponse()->setHttpHeader('Content-Type','application/json; charset=utf-8');
return $this->renderText(json_encode($json));
}