<?php
namespace App\Controller\Frontend;
use App\Entity\Library;
use App\Entity\Partner;
use App\Entity\OurStudent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use FOS\RestBundle\Controller\Annotations as Rest;
use Symfony\Contracts\Translation\TranslatorInterface;
class PageController extends BaseFrontendController
{
/**
* @Rest\Get("/career-path", name="career_path")
*/
public function careerPath(TranslatorInterface $translator)
{
$data['index'] = '';
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'career.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'career.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('pages/career.html.twig', [
$data
]);
}
/**
* @Rest\Get("/english", name="page_english")
*/
public function pageEnglish(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'english.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'english.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('language/english.html.twig', ['campuses' => $this->campusRepo->getAll(['filter_status' => 1, 'sort_asc' => 'ordering'], 'ENTITY')]);
}
/**
* @Rest\Get("/china", name="page_china")
*/
public function pageChina(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'china.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'china.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('language/china.html.twig', ['campuses' => $this->campusRepo->getAll(['filter_status' => 1, 'sort_asc' => 'ordering'], 'ENTITY')]);
}
/**
* @Rest\Get("/accreditations-academic-partners", name="accreditations_academic_partners")
*/
public function partnersPath(TranslatorInterface $translator)
{
$data['index'] = '';
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'partners.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'partners.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('pages/partners.html.twig', [
$data
]);
}
/**
* @Route("/{_locale}/lalternance-comment-ca-marche", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="alternance")
*/
public function alternance(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'alternance.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'alternance.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('pages/alternance.html.twig');
}
/**
* @Route("/{_locale}/temoignages-de-nos-etudiants", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="page.our_student")
*/
public function ourStudent(TranslatorInterface $translator)
{
$siteName = $translator->trans('siteName');
$this->addTitle($translator->trans(
'our_student.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'our_student.desc',
[
'%siteName%' => $siteName
]
));
$data['outStudentArticles'] = $this->ourStudentRepo->getAllOurStudentByType(OurStudent::TYPE_ARTICLE);
$data['outStudentVideos'] = $this->ourStudentRepo->getAllOurStudentByType(OurStudent::TYPE_VIDEO);
return $this->render('pages/our_student.html.twig', $data);
}
/**
* @Route("/{_locale}/lecole-en-images", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="page.estiam_en_images")
*/
public function estiamEnImages(TranslatorInterface $translator)
{
$siteName = $translator->trans('siteName');
$videos = $this->libraryService->getListByType(Library::TYPE_VIDEO);
$photos = $this->libraryService->getListByType(Library::TYPE_PHOTO);
$this->addTitle($translator->trans(
'estiam_en_images.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans('estiam_en_images.desc'));
return $this->render('pages/estiam_en_images.html.twig', [
'videos' => $videos,
'photos' => $photos
]);
}
/**
* @Route("/{_locale}/faq", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="faq")
*/
public function faq(TranslatorInterface $translator)
{
$siteName = $translator->trans('siteName');
$this->addTitle($translator->trans(
'faq.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans('faq.desc'));
$data['topics'] = $this->topicRepo->getAll(
['sort_asc' => 'ordering']
);
return $this->render('pages/faq.html.twig', $data);
}
/**
* @Route("/{_locale}/nos-campus", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="campus.index")
*/
public function campus(TranslatorInterface $translator, Request $request)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'campus.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'campus.desc',
[
'%siteName%' => $siteName
]
));
// list center with center gmap location
try {
$ip = $request->getClientIp();
$country = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip))->geoplugin_countryCode;
} catch (\Exception $e) {
$country = 'FR';
}
return $this->render(
'campus/index.html.twig',
[
'centers' => $this->campusService->getCenterMapLocationList(),
'campuses' => $this->campusRepo->getAll(['filter_status' => 1, 'sort_asc' => 'ordering'], 'ENTITY'),
'country' => $country
]
);
}
/**
* @Route("/{_locale}/nos-campus/{slug}", requirements={"_locale": "en|fr", "slug": "[a-zA-Z0-9\-]+"}, defaults={"_locale"="fr"}, name="campus_detail")
*/
public function campusDetail($slug, TranslatorInterface $translator)
{
$campus = $this->campusRepo->findOneBy(['slug' => $slug]);
if (!$campus) {
throw $this->createNotFoundException('');
}
$this->addTitle(empty($campus->getSeoTitle()) ? ($translator->trans('ÉSTIAM - Découvrez campus') . ' ' . $campus->getName()) : $campus->getSeoTitle());
$this->setDescription(empty($campus->getSeoDescription()) ? $translator->trans(
'campus_detail.desc',
[
'%campusName%' => $campus->getName()
]
) : $campus->getSeoDescription());
$centerLocationList = $this->campusService->getCenterMapLocationList($campus, 'campus/centerMapInfoSingle.html.twig');
$jpos = $this->openDayRepo->getListByCampusId($campus->getId());
return $this->render(
'campus/detail.html.twig',
[
'campus' => $campus,
'jpos' => $jpos,
'outStudentArticles' => $this->ourStudentRepo->getAllOurStudentByType(OurStudent::TYPE_ARTICLE, 5),
'centerLocationList' => $centerLocationList
]
);
}
/**
* @Route("/{_locale}/nos-valeurs", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="nos_valeurs")
*/
public function nosValeurs(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'nos_valeurs.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'nos_valeurs.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/nos_valeurs.html.twig');
}
/**
* @Route("/{_locale}/l-ecole-pourquoi-etudier-a-estiam", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="etudier_estiam")
*/
public function etudierEstiam(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'etudier_estiam.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'etudier_estiam.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/etudier_estiam.html.twig');
}
/**
* @Route("/{_locale}/notre-pedagogie", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="pedagogie")
*/
public function pedagogie(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'pedagogie.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'pedagogie.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/pedagogie.html.twig');
}
/**
* @Route("/{_locale}/cursus-et-specialisations", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="cursus")
*/
public function cursus(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'cursus.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'cursus.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/cursus.html.twig');
}
/**
* @Route("/{_locale}/habilitations-et-qualite", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="habilitations")
*/
public function habilitations(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'habilitations.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'habilitations.desc',
[
'%siteName%' => $siteName
]
));
$data['partners'] = $this->partnerRepo->getAll(['filter_status' => Partner::STATUS_ACTIVE], 'App\DTO\Partner\PartnerOutput');
return $this->render('ecole/habilitations.html.twig', $data);
}
/**
* @Route("/{_locale}/conseil-de-perfectionnement", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="conseil")
*/
public function conseil(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'conseil.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'conseil.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/conseil.html.twig');
}
/**
* @Route("/{_locale}/etudier-en-situation-de-handicap", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="etudier_handicap")
*/
public function etudierHandicap(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'etudier_handicap.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'etudier_handicap.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('ecole/etudier_handicap.html.twig');
}
/**
* @Route("/{_locale}/apply-offre", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="apply_offre")
*/
public function applyOffre(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'offres.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'offres.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('entreprises/apply_offre.html.twig');
}
/**
* @Route("/{_locale}/comment-integrer-un-de-nos-etudiants-dans-votre-entreprise", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="integrer_etudiants")
*/
public function integrerEtudiants(TranslatorInterface $translator)
{
$this->addTitle($translator->trans(
'integrer_etudiants.title'
));
$this->setDescription($translator->trans(
'integrer_etudiants.desc'
));
return $this->render('entreprises/integrer_etudiants.html.twig');
}
/**
* @Route("/{_locale}/cga", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="cga")
*/
public function cga(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'cga.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'cga.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/cga.html.twig');
}
/**
* @Route("/{_locale}/cgi", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="cgi")
*/
public function cgi(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'cgi.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'cgi.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/cgi.html.twig');
}
/**
* @Route("/{_locale}/cgv", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="cgv")
*/
public function cgv(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'cgv.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'cgv.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/cgv.html.twig');
}
/**
* @Route("/{_locale}/charte-utilisation", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="charte_utilisation")
*/
public function charteUtilisation(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'charte_utilisation.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'charte_utilisation.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/charte_utilisation.html.twig');
}
/**
* @Route("/{_locale}/reglement-interieur", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="reglement_interieur")
*/
public function reglementInterieur(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'reglement_interieur.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'reglement_interieur.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/reglement_interieur.html.twig');
}
/**
* @Route("/{_locale}/mentions-legales", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="mentions_legales")
*/
public function mentionsLegales(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'mentions_legales.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'mentions_legales.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/mentions_legales.html.twig');
}
/**
* @Route("/{_locale}/reglement-des-etudes", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="reglement_etudes")
*/
public function reglementEtudes(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'reglement_etudes.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'reglement_etudes.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('policy/reglement_etudes.html.twig');
}
/**
* @Route("/{_locale}/satisfaction-etudiants", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="satisfaction_etudiants")
*/
public function satisfactionEtudiants(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'satisfaction_etudiants.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'satisfaction_etudiants.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('pages/satisfaction_etudiants.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-estiam", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_aide")
*/
public function bonsAide(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/aide.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-voyagez", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_voyagez")
*/
public function bonsVoyages(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/voyagez.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-permis", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_permis")
*/
public function bonsPermis(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/permis.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-informatique", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_informatique")
*/
public function bonsInformatique(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/informatique.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-cultivez", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_cultivez")
*/
public function bonsCultivez(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/cultivez.html.twig');
}
/**
* @Route("/{_locale}/bons-plans-etudiants-shopping", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_shopping")
*/
public function bonsShopping(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/shopping.html.twig');
}
/**
* @Route("/{_locale}/logement-etudiant-paris-colette-estiam", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_aide1")
*/
public function bonsAide1(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide1.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide1.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/aide-1.html.twig');
}
/**
* @Route("/{_locale}/emmenagement-facile-estiam-mondopal", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_aide2")
*/
public function bonsAide2(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide2.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide2.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/aide-2.html.twig');
}
/**
* @Route("/{_locale}/logement-etudiant-smartgarant-estiam", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_aide3")
*/
public function bonsAide3(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide3.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide3.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/aide-3.html.twig');
}
/**
* @Route("/{_locale}/conseil-recherche-logement", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="bons_aide4")
*/
public function bonsAide4(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'bons_aide4.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'bons_aide4.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('bons/aide-4.html.twig');
}
/**
* @Route("/{_locale}/autofinancement-des-etudes", requirements={"_locale": "en|fr"}, defaults={"_locale"="fr"}, name="autofinancement")
*/
public function autofinancement(TranslatorInterface $translator)
{
$siteName = $this->getParameter('site_name');
$this->addTitle($translator->trans(
'autofinancement.title',
[
'%siteName%' => $siteName
]
));
$this->setDescription($translator->trans(
'autofinancement.desc',
[
'%siteName%' => $siteName
]
));
return $this->render('alternance/autofinancement.html.twig');
}
}