grantus
Active member
I'm building a page where I'm checking the params to see who is on the page, either a sender or receiver.
In my URL it would be like this:
sender: cpanel/challenge/{id here}/
receiver: cpanel/challenge/view/{alert id here}/
The issue is that since 'challenge' is in the URL for both, it's never grabbing the 'view' value from the params, so I've set up two functions like this:
What would be the best approach?
In my URL it would be like this:
sender: cpanel/challenge/{id here}/
receiver: cpanel/challenge/view/{alert id here}/
The issue is that since 'challenge' is in the URL for both, it's never grabbing the 'view' value from the params, so I've set up two functions like this:
Code:
public function getChallengeUserId(ParameterBag $params) {
// Retrieve and filter the 'challenge' parameter from the URL
$params_challenge_user_id = // filterURL here
return $params_challenge_user_id;
}
public function getViewUserId(ParameterBag $params) {
// Retrieve and filter the 'view' parameter from the URL
$params_view_user_id = // filterURL here
return $params_view_user_id;
}
What would be the best approach?