public static function validateAmountEdit($name, $ingredients, $id, $amounts) { foreach ($amounts as $amount) { $amount_errors = DrinkIngredient::validateAmount($amount); if (count($amount_errors) > 0) { $drink = Drink::findOne($id); $drink_types = DrinkType::listDrinkTypes(); $drink_ingredients = DrinkIngredient::listDrinkIngredients($id); View::make('drink/edit.html', array('attributes' => $drink, 'drink_types' => $drink_types, 'drink_ingredients' => $drink_ingredients, 'message' => $amount_errors[0])); } } }