thecodeholic / tc-php-mvc-core

103 stars 30 forks source link

get query string as an object through Request class #11

Open marufsharia opened 1 year ago

marufsharia commented 1 year ago

Using $request->getQueryString() method to easily gets a query string as an object. For Example

  public function profileByName(Request $request)
    {
        echo '<pre>';
        // http://127.0.0.1:8080/profile/marufsharia?id=123&categoryId=102&type=small
        var_dump($request->getQueryString()->catagoryId); // output : 102
        echo '</pre>';
    }