src/Controller/PagesController.php line 92
<?php
namespace App\Controller;
use App\Bundles\UptimeRobot\Api;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class PagesController extends AbstractController
{
#[Route('/', name: 'app_homepage')]
public function index(): Response
{
$data = [
'pageTitle' => 'Web Hosting in Wales, UK | Little Welsh Hosting Company',
'pageDescription' => "Wales' newest Web Hosting provider. Top UK-based support, unlimited bandwidth and cPanel control panel. PCI Compliant hosting, VPS & Dedicated hosting.",
];
return $this->render('pages/homepage.html.twig', [
'data' => $data
]);
}
#[Route('/cy/', name: 'app_welsh')]
public function welsh(): Response
{
$data = [
'pageTitle' => 'Croeso i Gymraeg | Little Welsh Hosting Company',
'pageDescription' => '',
];
return $this->render('pages/welsh.html.twig', [
'data' => $data
]);
}
#[Route('/privacy-policy', name: 'app_privacy')]
public function privacy(): Response
{
$data = [
'pageTitle' => 'Privacy Policy | Little Welsh Hosting Company',
'pageDescription' => '',
];
return $this->render('pages/privacy.html.twig', [
'data' => $data,
]);
}
#[Route('/terms-conditions', name: 'app_terms')]
public function terms(): Response
{
$data = [
'pageTitle' => 'Terms & Conditions | Little Welsh Hosting Company',
'pageDescription' => '',
];
return $this->render('pages/terms.html.twig', [
'data' => $data,
]);
}
/**
* @throws \Exception
*/
#[Route('/stats', name: 'app_stats')]
public function stats(Request $request)
{
$data = [
'pageTitle' => 'Our Statistics | Little Welsh Hosting Company',
'pageDescription' => '',
];
$config = [
'apiKey' => $request->server->get('UPTIME_ROBOT_APIKEY'),
'url' => 'https://api.uptimerobot.com/v2'
];
$api = new API($config);
$args = [];
$results = $api->request('/getMonitors', $args);
return $this->render('pages/stats.html.twig', [
'data' => $data,
'uptime' => $results
]);
}
#[Route('/green', name: 'app_green')]
public function green()
{
$data = [
'pageTitle' => 'Our Green Web Hosting Pledge | Little Welsh Hosting Company',
'pageDescription' => '',
];
return $this->render('pages/green.html.twig', [
'data' => $data,
]);
}
}