I have a modification where the username and id are parameters in the route, ie:
http://site.com/hello-world/jeremy-p.450/
Using resolveActionWithIntegerParam(), I am able to get the user_id in the controller fine. However, in the event the username does not match the id, I'd like to redirect to the matching username, much like user profiles do by default. I'm not sure how to go about it.. any ideas?
Thanks.
Edit - Another question:
I have an action that accepts post data from a form in another action. It ends with a redirect response:
When the form is posted, the success message is flashed at the top of the screen, but no redirect occurs. How would I invoke the redirect after the success message, like how it is done if you go to the advanced post page?
http://site.com/hello-world/jeremy-p.450/
Using resolveActionWithIntegerParam(), I am able to get the user_id in the controller fine. However, in the event the username does not match the id, I'd like to redirect to the matching username, much like user profiles do by default. I'm not sure how to go about it.. any ideas?
Thanks.
Edit - Another question:
I have an action that accepts post data from a form in another action. It ends with a redirect response:
PHP:
return $this->responseRedirect(XenForo_ControllerResponse_Redirect::RESOURCE_CREATED,
XenForo_Link::buildPublicLink('hello-world', $visitor), new XenForo_Phrase('helloWorld_the_data_has_been_added_successfully'));