Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

URL parameters in plugin

Solved by Claud Rusnac View solution

Started by Claud Rusnac 8 years ago · 2 replies · 958 views
8 years ago

I am trying to capture a url parameter as a variable in a plugin, but my current method doesn't seem to work.

my url parameter http://mysite.com/filter/role:data-owner

accessing the url parameter $this->grav['uri.param']

Help please.

8 years ago

@crusnac You might try the following:

PHP
$this->grav['uri']->param('role');

'param()' is a method of class Uri.

8 years ago Solution

Thanks, I was able to use $this->grav['uri']->params(); for my needs.

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago