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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

URL parameters in plugin

Solved by Claud Rusnac View solution

Started by Claud Rusnac 7 years ago · 2 replies · 622 views
7 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.

7 years ago

@crusnac You might try the following:

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

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

7 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 Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago