feat: improve layout of contacts page
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller\Teamer;
|
||||
|
||||
use App\Entity\Contact;
|
||||
use App\Repository\ContactRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -15,19 +16,23 @@ class ContactController extends AbstractController
|
||||
#[Route('/teamer/contact', name: 'app_teamer_contact')]
|
||||
public function index(): Response
|
||||
{
|
||||
$generalContacts = $this
|
||||
$allContacts = $this
|
||||
->contactRepository
|
||||
->getGeneralContacts()
|
||||
->findAll()
|
||||
;
|
||||
|
||||
$destinationContacts = $this
|
||||
->contactRepository
|
||||
->getDestinationContacts()
|
||||
;
|
||||
$contacts = [
|
||||
Contact::CATEGORY_HR => [],
|
||||
Contact::CATEGORY_MANAGEMENT => [],
|
||||
Contact::CATEGORY_HOUSE_MANAGEMENT => [],
|
||||
];
|
||||
|
||||
foreach ($allContacts as $contact) {
|
||||
$contacts[$contact->getCategory()][] = $contact;
|
||||
}
|
||||
|
||||
return $this->render('teamer/contact/index.html.twig', [
|
||||
'generalContacts' => $generalContacts,
|
||||
'destinationContacts' => $destinationContacts,
|
||||
'contacts' => $contacts,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user