Use Breadcrumb class

Convert to use NavList::PRESENT_LINK constant
This commit is contained in:
Ryan Prather 2024-12-17 11:53:45 -05:00
parent f17be14174
commit a42ce28f14

View File

@ -6,6 +6,7 @@ use App\Entity\MemberCase;
use App\Entity\Referral;
use App\Entity\User;
use App\Form\ReferralFormType;
use App\Libs\Breadcrumb;
use App\Libs\NavList;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -21,6 +22,7 @@ class ReferralController extends AbstractController
private array $navLinks = []
) {
$this->navLinks = NavList::LIST;
$this->navLinks['case_list'] = NavList::PRESENT_LINK;
}
#[Route('/list-referrals/{id}', name: 'app_list_referrals')]
@ -36,8 +38,8 @@ class ReferralController extends AbstractController
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Referrals'
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
new Breadcrumb($this->generateUrl('app_list_referrals', ['id' => $case->getId()]), 'Referrals'),
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
@ -74,8 +76,9 @@ class ReferralController extends AbstractController
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Add Referral'
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
new Breadcrumb($this->generateUrl('app_list_referrals', ['id' => $case->getId()]), 'Referrals'),
new Breadcrumb($this->generateUrl('app_case_add_referral', ['id' => $case->getId()]), 'Add Referral')
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,
@ -108,8 +111,9 @@ class ReferralController extends AbstractController
$this->navLinks,
[
'breadcrumbs' => [
'Case',
'Edit Referral'
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
new Breadcrumb($this->generateUrl('app_list_referrals', ['id' => $case->getId()]), 'Referrals'),
new Breadcrumb($this->generateUrl('app_case_edit_referral', ['caseId' => $case->getId(), 'referralId' => $referral->getId()]), 'Edit Referral'),
],
'notifications' => $user->retrieveUnreadNotifications(),
'case' => $case,