<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/kontakt", name="contact_")
*/
class ContactController extends AbstractController
{
/**
* @Route("/", name="index")
*/
public function index()
{
/* Get meta from api */
$metaJson = null;
try {
$metaJsonPath = @file_get_contents('https://api.ctc-rheda.de/api/singletons/get/contact?token=863f1ccdb97de3b924e07b600ce0f5');
if ($metaJsonPath !== false) {
$metaJson = json_decode($metaJsonPath, true);
}
} catch (\Exception $e) {
error_log('API Error in ContactController: ' . $e->getMessage());
}
// Fallback if API is not available
if ($metaJson === null) {
$metaJson = [
'title' => 'Kontakt',
'description' => 'Kontakt zum Cor Tennisclub aufnehmen.',
'keywords' => 'Tennis, Kontakt, CTC, Rheda'
];
}
return $this->render('pages/footer/contact.html.twig', [
'page' => array(
'title' => 'Kontakt',
'description' => 'Kontakt zum Cor Tennisclub aufnehmen.',
'meta' => $metaJson
)
]);
}
}