Jump to content

Recommended Posts

Posted

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!

Posted

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
Posted

Awesome!

Do you know if there a away to cache an admin page for x minutes?  I got it working on a template page but not sure if it is different or not in a module.

Thanks!

Posted

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

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
  • Recently Browsing   0 members

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