first commit
This commit is contained in:
36
bundles/KupShop/OrderingBundle/Controller/IsicController.php
Normal file
36
bundles/KupShop/OrderingBundle/Controller/IsicController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user