1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect Flash Message

Discussion in 'XenForo Development Discussions' started by Aayush, Aug 27, 2014.

  1. Aayush

    Aayush Well-Known Member

    Is there a way on XenForo to get flash message when you are redirected from an action to another action?
    Is there a way to access the message sent via responseRedirect?

  2. lol768

    lol768 Active Member

    I've never actually seen in XenForo's code the $redirectMessage of the renderRedirect mehtod on the abstract ViewRenderer ever used. The docblock states "* @param mixed Redirect message (unused by some redirect methods)" which to me basically suggests it's completely unused. I can't see that the message is used anywhere in the codebase and the XenForo_ControllerResponse_Redirect's redirectMessage property is only ever read in the FrontController class and passed to the
    renderRedirect method on the ViewRenderer.

    tl;dr I don't think you can get access to this short of overriding the renderRedirect method on the XenForo_ViewRenderer_Abstract class and writing your own implementation that does actually use it.

    It's not clear on first glance that the property isn't used and I've wasted a few minutes trying to figure out how to access the message from a template myself. Of course, I'd normally have referred to development documentation for more information but oh .. I forgot, there isn't any.

Share This Page