[dokuwiki] Re: Is there any way to pass information from one instance of doku.php to another - i.e. for an action?

  • From: Michael Hamann <michael@xxxxxxxxxxxxxxxx>
  • To: dokuwiki <dokuwiki@xxxxxxxxxxxxx>
  • Date: Thu, 30 Jun 2011 18:39:57 +0200

Hi,

Excerpts from Chris G's message of 2011-06-30 17:59:30 +0200:
> If one implements something in Dokuwiki where one page starts another
> via a ...?do=<action> then there is no easy way to pass any information
> from the 'caller' to the 'called' page.  In some cases there are specific
> ways to do it but there seems to be no generic way.

You could pass additional parameters in the URL (or maybe I yet haven't
fully understood what you want to do).

> The current case I'm playing with is where the 'caller' is doing a
> 'do=search' and I want to manipulate the search in the 'called' page
> using event SEARCH_QUERY_FULLPAGE.  As it is, apart from the query text
> itself there's no easy way to get information across to modify the
> search.

You could also use the referrer (but that's information the browser may
or may not send) or as I've said additional parameters and process them
in the event.

> One could simply write to a file (I have resorted to this approach
> previously) and read it at the called end but it feels as if there
> should be a better way to do it - or at least a built in way of some
> sort, like sort of 'super globals'.

The PHP way for storing information during requests is the session.  The
session is however shared between all requests in a window/browser
session, i.e. you don't know that the information in the session is
really from the page the user comes from (and not from the page the user
has just opened in a new tab) but that's a problem you also get when you
write your own files.

Michael
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: