37 lines
993 B
PHP
37 lines
993 B
PHP
<?php
|
|
|
|
namespace KupShop\OrderingBundle\Controller;
|
|
|
|
use KupShop\KupShopBundle\Exception\RedirectException;
|
|
use KupShop\OrderingBundle\View\IsicView;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
|
|
class IsicController extends AbstractController
|
|
{
|
|
/**
|
|
* @Route("/isic/")
|
|
*/
|
|
public function isicAction(Request $request, IsicView $view): Response
|
|
{
|
|
if (!findModule('isic')) {
|
|
throw new RedirectException(path('home'));
|
|
}
|
|
|
|
$view->setSession($request->getSession());
|
|
|
|
$data = $request->get('data');
|
|
if ($request->get('Submit') && !empty($data['id'])) {
|
|
$view->handleSubmit($data['id'], $data['name'] ?? null);
|
|
}
|
|
|
|
if ($request->get('cancel')) {
|
|
$view->handleCancel();
|
|
}
|
|
|
|
return $view->getResponse();
|
|
}
|
|
}
|