public function createPhotosBlock() { if ($this->modulesManager->getModuleByIdentifier('argentique')->isEnabled()) { $photos = $this->builder->getPhotos(); if (count($photos) > 0) { $block = ['template' => 'EtuCoreBundle:Main/index_blocks:photos.html.twig', 'context' => ['photos' => $photos]]; } } return isset($block) ? $block : false; }