DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:action_show_redirect

This is an old revision of the document!


ACTION_SHOW_REDIRECT

Description:
intercept redirects after posts
DefaultAction:
execute a redirect
Preventable:
yes
Added:
2008-10-26

When the action is changed to show after a POST request, DokuWiki will do a redirect. This event allows you to modify the redirect or prevent it altogether. It's signaled from act_redirect() in inc/actions.php.

Passed Data

The passed Doku_Event object has the fields: $data and $result.

The $data field is an array with the entries:

  • $data['id'] – the page id the redirect goes to
  • $data['fragment'] – a fragment identifier if any (hash part of the URL)
  • $data['preact'] – the (uncleaned) action before it was changed to show

The BEFORE event handler let you modify the $data field or stop with preventDefault() the default action act_redirect_execute().

The $result field is always null, and never set to a value by the default action. The AFTER event handler is default not reached, but only when default action is prevented.

Plugins handling this event

The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.

Plugins that trigger this event

See also

devel/event/action_show_redirect.1527606522.txt.gz · Last modified: 2018-05-29 17:08 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki