This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

extrauksus744
extrauksus744

How can I get parameters from url? I know that with $this->param() I can get parameters like "10" and "3" from domain.com/blog/10/3 for example. But how to get params from original url like domain.com?cat=10&post=3. $_GET is not working.

Last updated

Daniel81
Daniel81

Input::get("cat");

Input::get("post");

Last updated

extrauksus744
extrauksus744

Thank you, didn't know about this class

Daniel81
Daniel81

You can also use the Laravel docs as well as the October docs as October is built on Laravel

daftspunky
daftspunky

October has a helper you can use also:

post('cat');

post('post');
nikki15963
nikki15963

I'm trying to do something similar with a url query string but it does not seem to work

http://www.mydomain.com/page-name?status=2

I want to get the value of 'status' so I've tried:

Request::get('status');
Input::get('status');

How can I achieve this?

alxy
alxy

input('status') should do the trick.

charlieblue53129
charlieblue53129

I'm still learning .... I lose 3 days trying the solution, javascript PHP twig ... and finally I saw this post with the answer ... Thanks :) alxy

moh.thabet200631375
moh.thabet200631375

use: function onStart(){ $this['q'] = request()->get('q'); }

1-9 of 9

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.