# Slim3 parameter issues

**URL:** https://discourse.slimframework.com/t/slim3-parameter-issues/1918
**Category:** Questions
**Created:** [October 22, 2017, 9:10pm UTC](https://discourse.slimframework.com/t/slim3-parameter-issues/1918 "2017-10-22T21:10:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wakilahmad](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@wakilahmad](https://discourse.slimframework.com/u/wakilahmad)
#### Post date: [October 22, 2017, 9:10pm UTC](https://discourse.slimframework.com/t/slim3-parameter-issues/1918/1 "2017-10-22T21:10:54Z")

</div>

```
$app->get('/mobile/byCategory/{id}{offset}{random}', function ($request, $response, $args) 
{  
    $categoryId = $args['id'];
    $page = $args['offset'];
    $random = $args['random'];
 }

```

I am sending request using Retrofit 2 from mobile device like this successfully:  
…/mobile/byCategory/4610  
Where  
46 is category id  
1 is offset  
0 is random

But when i reach at offset 10 like  
…/mobile/byCategory/46100  
now slim3 retrieves parameters as  
461 category id (but i send 46)  
0 offset (but i send 10)  
random is also 0

Please tell me the proper way to receive parameters. I will be very thankful.

---

<div class="post-metadata">

### Author: ![tflight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/tflight/32/1205_2.png) [@tflight](https://discourse.slimframework.com/u/tflight)
#### Post date: [October 23, 2017, 1:32pm UTC](https://discourse.slimframework.com/t/slim3-parameter-issues/1918/2 "2017-10-23T13:32:32Z")

</div>

It doesn’t look like you’ve given Slim any means to know which parameter is which. Is the category always two digits? Is the offset always one digit? Is the random always one digit?

Perhaps you could change the way the request is sent to something like this:

```php
// /mobile/byCategory/46/1/0
$app->get('/mobile/byCategory/{id}/{offset}/{random}', function ($request, $response, $args)

```

Or maybe use regex if the number of characters are known

```php
// /mobile/byCategory/4610
$app->get('/mobile/byCategory/{id:[0-9]{2}}', function ($request, $response, $args)

```

---

<div class="post-metadata">

### Author: ![wakilahmad](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@wakilahmad](https://discourse.slimframework.com/u/wakilahmad)
#### Post date: [November 6, 2017, 7:23pm UTC](https://discourse.slimframework.com/t/slim3-parameter-issues/1918/3 "2017-11-06T19:23:32Z")

</div>

Thank you. I have solved it by using query parameters in Get request.
