<?php
namespace App\Controller;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class faqController extends AbstractController
{
private $client;
public function __construct(HttpClientInterface $client)
{
$this->client = $client;
}
/**
* @Route("/faq")
*/
public function renderFaqPage()
{
$response = $this->client->request(
'GET',
"{$_ENV['BASE_API']}faqs"
);
$content = $response->toArray()["faqs"];
return $this->render('./faq/faq.html.twig', array(
"faqs" => $content,
"pro" => "false",
"base" => "base.html.twig"
));
}
/**
* @Route("/pro/faq")
*/
public function renderFaqProPage()
{
$response = $this->client->request(
'GET',
"{$_ENV['BASE_API']}faqs/pro"
);
$content = $response->toArray()["faqs"];
return $this->render('./faq/faq.html.twig', array(
"faqs" => $content,
"pro" => "true",
"base" => "/pro/base.html.twig"
));
}
}
?>