src/Controller/ServersController.php line 23
<?php
namespace App\Controller;
use App\Dreamscape\ResellerApiSdk\Api;
use App\Dreamscape\ResellerApiSdk\Authenticator\ApiKey;
use App\Dreamscape\ResellerApiSdk\Http\Adapter\Curl;
use App\Dreamscape\ResellerApiSdk\Filter;
use App\Dreamscape\ResellerApiSdk\Exception;
use App\Entity\DedicatedServers;
use App\Entity\HostingPackages;
use App\Entity\ProductTypes;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class ServersController extends AbstractController
{
private Api $apiKey;
#[Route('/vps-servers', name: 'app_vps_servers')]
public function vps(ManagerRegistry $doctrine)
{
$data = [
'pageTitle' => 'VPS Server Management in Wales | Little Welsh Hosting Company',
'pageDescription' => '',
];
$hosting = $doctrine->getRepository(ProductTypes::class)->findOneBy([
'dreamscapeName' => 'Servers'
]);
$products = $doctrine->getRepository(HostingPackages::class)->findBy([
'type' => $hosting,
'isActive' => 1
],[
'position' => 'ASC'
]);
return $this->render('servers/vps.html.twig', [
'data' => $data,
'products' => $products
]);
}
#[Route('/dedicated-servers', name: 'app_dedicated_servers')]
public function dedicated(ManagerRegistry $doctrine)
{
$data = [
'pageTitle' => 'Dedicated Servers in Wales | Little Welsh Hosting Company',
'pageDescription' => '',
];
$featured = $doctrine->getRepository(DedicatedServers::class)->findBy([
'isFeatured' => 1,
'isActive' => 1
],[
'sell_price' => 'ASC'
]);
$products = $doctrine->getRepository(DedicatedServers::class)->findAll();
return $this->render('servers/dedicated.html.twig', [
'data' => $data,
'featured' => $featured,
'products' => $products
]);
}
}