src/Controller/ServersController.php line 23

  1. <?php
  2. namespace App\Controller;
  3. use App\Dreamscape\ResellerApiSdk\Api;
  4. use App\Dreamscape\ResellerApiSdk\Authenticator\ApiKey;
  5. use App\Dreamscape\ResellerApiSdk\Http\Adapter\Curl;
  6. use App\Dreamscape\ResellerApiSdk\Filter;
  7. use App\Dreamscape\ResellerApiSdk\Exception;
  8. use App\Entity\DedicatedServers;
  9. use App\Entity\HostingPackages;
  10. use App\Entity\ProductTypes;
  11. use Doctrine\Persistence\ManagerRegistry;
  12. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  13. use Symfony\Component\HttpFoundation\Response;
  14. use Symfony\Component\Routing\Annotation\Route;
  15. class ServersController extends AbstractController
  16. {
  17.     private Api $apiKey;
  18.     #[Route('/vps-servers'name'app_vps_servers')]
  19.     public function vps(ManagerRegistry $doctrine)
  20.     {
  21.         $data = [
  22.             'pageTitle' => 'VPS Server Management in Wales | Little Welsh Hosting Company',
  23.             'pageDescription' => '',
  24.         ];
  25.         $hosting $doctrine->getRepository(ProductTypes::class)->findOneBy([
  26.             'dreamscapeName' => 'Servers'
  27.         ]);
  28.         $products $doctrine->getRepository(HostingPackages::class)->findBy([
  29.             'type' => $hosting,
  30.             'isActive' => 1
  31.         ],[
  32.             'position' => 'ASC'
  33.         ]);
  34.         return $this->render('servers/vps.html.twig', [
  35.             'data' => $data,
  36.             'products' => $products
  37.         ]);
  38.     }
  39.     #[Route('/dedicated-servers'name'app_dedicated_servers')]
  40.     public function dedicated(ManagerRegistry $doctrine)
  41.     {
  42.         $data = [
  43.             'pageTitle' => 'Dedicated Servers in Wales | Little Welsh Hosting Company',
  44.             'pageDescription' => '',
  45.         ];
  46.         $featured $doctrine->getRepository(DedicatedServers::class)->findBy([
  47.             'isFeatured' => 1,
  48.             'isActive' => 1
  49.         ],[
  50.             'sell_price' => 'ASC'
  51.         ]);
  52.         $products $doctrine->getRepository(DedicatedServers::class)->findAll();
  53.         return $this->render('servers/dedicated.html.twig', [
  54.             'data' => $data,
  55.             'featured' => $featured,
  56.             'products' => $products
  57.         ]);
  58.     }
  59. }