diff --git a/src/Controller/ReferralController.php b/src/Controller/ReferralController.php index 182ab24..1340a3b 100644 --- a/src/Controller/ReferralController.php +++ b/src/Controller/ReferralController.php @@ -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,