Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

URL parameters in plugin

Solved by Claud Rusnac View solution

Started by Claud Rusnac 8 years ago · 2 replies · 759 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 Paul Hodges, 4 weeks ago
19 484 5 days ago
Support · by Lauw, 7 days ago
2 99 7 days ago
Support · by Anna, 3 weeks ago
4 426 1 week ago
Support · by gtx, 4 weeks ago
4 377 3 weeks ago
Support · by Anna, 1 month ago
9 484 3 weeks ago