Jump to content

Can Admin Pages/modules Use Query Strings?


joer80
 Share

Recommended Posts

Is it possible to make an admin module read query strings?

I made a reports module for a reports page and want to be able to click a link, and it pass a query string for details for that line item.  

Is there a better way to do it?

Thanks!

Link to comment
Share on other sites

Of course! Just have a look at how the admin works: .../processwire/page/edit/?id=1031

In that particular case, the query is handled by the ProcessPageEdit module with the following line:

            else if(isset($_GET['id'])) $this->id = (int) $_GET['id'];
  • Like 1
Link to comment
Share on other sites

Yep it does. 

If not installed, calling the MarkupCache like below will install it and function.

$cache = $this->modules->get("MarkupCache"); // See the $this-> call
if(!$data = $cache->get("something")) {
    $data = "test me";
    $cache->save($data);
}

return $data; // contains "test me"
  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...