vendor/bugbuster/contao-banner-bundle/src/Controller/BannerFeController.php line 38

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of a BugBuster Contao Bundle
  5.  *
  6.  * @copyright  Glen Langer 2020 <http://contao.ninja>
  7.  * @author     Glen Langer (BugBuster)
  8.  * @package    Contao Banner Bundle
  9.  * @license    LGPL-3.0-or-later
  10.  * @see        https://github.com/BugBuster1701/contao-banner-bundle
  11.  */
  12. namespace BugBuster\BannerBundle\Controller;
  13. use BugBuster\Banner\FrontendBanner;
  14. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  15. use Symfony\Component\HttpFoundation\Response;
  16. use Symfony\Component\Routing\Annotation\Route;
  17. /**
  18.  * Handles the Banner front end routes.
  19.  *
  20.  * @copyright  Glen Langer 2019 <http://contao.ninja>
  21.  *
  22.  * @Route("/bbfebanner", defaults={"_scope" = "frontend", "_token_check" = false})
  23.  */
  24. class BannerFeController extends AbstractController
  25. {
  26.     /**
  27.      * Renders the alerts content.
  28.      *
  29.      * @return Response
  30.      *
  31.      * @Route("/banclicks/{strbid}/{bid}", name="bugbuster_banner_frontend_clicks", requirements={"bid"="\d+"})
  32.      */
  33.     public function banclicksAction($strbid ''$bid 0)
  34.     {
  35.         if ('bid' !== $strbid && 'defbid' !== $strbid) {
  36.             return new Response('Invalid Banner Action ('.$strbid.')'501);
  37.         }
  38.         if (('bid' === $strbid && === $bid) || ('bid' === $strbid && $bid)) {
  39.             return new Response('Invalid Banner ID ('.$bid.')'501);
  40.         }
  41.         if (('defbid' === $strbid && === $bid) || ('defbid' === $strbid && $bid)) {
  42.             return new Response('Invalid Default Banner ID ('.$bid.')'501);
  43.         }
  44.         //$this->container->get('contao.framework')->initialize();
  45.         $this->get('contao.framework')->initialize();
  46.         $controller = new FrontendBanner();
  47.         return $controller->run($strbid$bid);
  48.     }
  49. }