ridgedale Posted October 9, 2018 Share Posted October 9, 2018 Reference: PW 3.0.111 and uikit3 based site using the Regular-Master profile. I'm trying to automatically redirect a logged-in user to a custom profile page using $session->redirect() and need to add $user->name to the redirect path. All my attempts appear to have failed: $session->redirect('/user-profile/')->name; $session->redirect('/user-profile/')->$user->name; $session->redirect('/user-profile/' . get($user->name . '/')); $session->redirect('/user-profile/' & get($user->name)); Can anyone point out where I am going wrong? Link to comment Share on other sites More sharing options...
louisstephens Posted October 9, 2018 Share Posted October 9, 2018 I do believe the following will work $session->redirect('/user-profile/' . $user->name); 1 Link to comment Share on other sites More sharing options...
dotnetic Posted October 9, 2018 Share Posted October 9, 2018 Or even easier with $session->redirect("/user-profile/$user->name"); 1 Link to comment Share on other sites More sharing options...
louisstephens Posted October 9, 2018 Share Posted October 9, 2018 Thanks jmartsch. I tried that earlier but forgot to switch the single ' for the " which is why it didnt work. Link to comment Share on other sites More sharing options...
ridgedale Posted October 9, 2018 Author Share Posted October 9, 2018 @louisstephens @jmartsch , Thank you both for your speedy solutions. Much appreciated. 2 hours ago, louisstephens said: Thanks jmartsch. I tried that earlier but forgot to switch the single ' for the " which is why it didnt work. I think I tried that as well making the same mistake. 😞 Thanks again to you both. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now