> For the complete documentation index, see [llms.txt](https://shoaib-1.gitbook.io/sirjuni/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoaib-1.gitbook.io/sirjuni/router/placeholder-types.md).

# Placeholder Types

Specify the type of data to be expected in the Placeholder

When creating routes with placeholders, we can specify the type of data in the placeholder that is to be expected. Currently this framework supports `int, string and path` types. Below we will see how to use these different types with placeholders.

To specify the type of placeholder, we write it in the format `name:type` in the route.

```php
Router::add_route("GET", '/echo/{name:string}', [Controller::class, 'index']);
```

### Integers

To specify integer placeholders in the route we use the type `int` .

```php
Router::add_route('GET', '/echo/{id:int}', [Controller::class, 'index']);
```

In the above line, we created a route `/echo/{id:int}` which would basically capture the number that comes after `/echo/` . It will only match integers and hence would cause error handler to be called if we use string or path in place of integer.

### Strings

To specify the placeholders as strings, we just use the type `string`.

```php
Router::add_route("GET", '/echo/{name:string}', [Controller::class, 'index']);
```

Now, placeholder will capture a string that comes after `/echo/`

### Path

Now, lets say i want to capture an entire Path which comes at the placeholders place. `path` type is used for this and it captures a path.

```php
Router::add_route('GET', '/echo/{way:path}', [Cont::class, 'index']);
```

So, now if a user tries to visit `/echo/shoaib/wani` the `way` placeholder will contain `shoaib/wani`.
