public function yourAction()
{
$invoice = array();
// Lets assume you fetched your $pizzas somewhere above. I hope they were tasty!
foreach ($pizzas as $pizza)
{
$invoiceLine = array("title" => $pizza['title'], "value" => $pizza['price']);
$invoice[] = $pizza;
}
$invoice[] = array('title' => "SUM before tax", "value" => your_function_to_calculate_sum_bt($pizzas));
$invoice[] = array('title' => "Tax", "value" => $taxRate);
$invoice[] = array('title' => "SUM after tax", "value" => your_function_to_calculate_sum($pizzas, $taxRate));
$viewParams = array("invoice" => $invoice);
return $this->responseView('Your_View_Class', 'your_template', $viewParams);
}