/**
  * @param Request $request
  *
  * @return \Knp\Menu\ItemInterface
  */
 public function createTrainingMenu(Request $request)
 {
     $menu = $this->factory->createItem('training');
     $trainingMenu = $menu->addChild('training', ['label' => $this->translator->trans('training.menu', [], 'training')]);
     foreach ($this->certificationManager->getCertifications() as $certificationName => $certificationLabel) {
         $trainingMenu->addChild($certificationName, ['route' => 'certification_guidelines', 'routeParameters' => ['name' => $certificationName], 'label' => $certificationLabel]);
     }
     return $menu;
 }
 /**
  * @param Request $request
  *
  * @return Response
  */
 public function footerAction(Request $request)
 {
     $response = new Response();
     $response->setPublic();
     $response->setSharedMaxAge(600);
     $response->setVary('Accept-Encoding', 'User-Agent');
     return $this->engine->renderResponse('@CertificationyWeb/Site/footer.html.twig', ['trainings' => $this->certificationManager->getCertifications()]);
 }
 /**
  * @param CertificationManager $certificationManager
  */
 public function addCertificationTemplateDir(CertificationManager $certificationManager)
 {
     if (!is_dir($this->baseDir)) {
         throw new \RuntimeException('certification-data folder not found: did you install the certifications ?');
     }
     foreach (array_keys($certificationManager->getCertifications()) as $certificationName) {
         $this->loader->addPath($this->baseDir . '/' . $certificationName, $certificationName);
     }
 }