<?php

namespace KupShop\KupShopBundle\Views\Traits;

use Symfony\Component\HttpFoundation\Request;

trait FormTrait
{
    public function getResponse(?Request $request = null)
    {
        if (!empty($_POST)) {
            $this->handleForm();
        }

        return parent::getResponse($request);
    }

    public function handleForm()
    {
        throw new \Exception('Missing handleForm method!');
    }
}
