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.
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Solved by Claud Rusnac View solution
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.
@crusnac You might try the following:
$this->grav['uri']->param('role');
'param()' is a method of class Uri.
Thanks, I was able to use $this->grav['uri']->params(); for my needs.
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 53 | 9 hours ago | ||
| 2 | 59 | 12 hours ago | ||
| 1 | 30 | 13 hours ago | ||
| 2 | 65 | 5 days ago | ||
| 2 | 56 | 5 days ago |