vendor/elements/hash-cash-form-bundle/src/Controller/AjaxController.php line 14

Open in your IDE?
  1. <?php
  2. namespace Elements\Bundle\HashCashBundle\Controller;
  3. use Pimcore\Cache;
  4. use Pimcore\Controller\FrontendController;
  5. use Elements\Bundle\HashCashBundle\Service\HashCashService;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\HttpFoundation\Request;
  8. class AjaxController extends FrontendController
  9. {
  10.     #[Route(path'/elhc/ajax/create-stamp'name'elhc_create-stamp')]
  11.     public function createStamp(Request $requestHashCashService $hashCashService) {
  12.         Cache::disable();
  13.         $uri crc32($request->get('uri'));
  14.         return $this->json($hashCashService->createStamp($uri), 200, [
  15.             'cache-control' => 'no-cache, no-store, must-revalidate',
  16.             'pragma' => 'no-cache',
  17.             'expires' => 0
  18.         ]);
  19.     }
  20. }