# fetchContent

Learn how to fetch the content of a slot.

This method fetches the personalized content of a [Slot](/explanation/slot) to render in your application.

For more information, see the [Content rendering](/reference/sdk/php/content-rendering) reference.

## Signature

This method has the following signature:

```php
public function fetchContent(string $slotId, ?FetchOptions $options = null): FetchResponse
```

This method returns a [response](/reference/sdk/php/api/response/fetch-response) with the resolved content. If the request fails and no fallback is set, it throws an [exception](/reference/sdk/php/api/exceptions/croct-exception).

## Example

Here is a basic example of how to use this method:

```php
<?php
use Croct\Plug\Croct;

$croct = Croct::fromDotenv();
$response = $croct->fetchContent('home-hero');
```

## Parameters

The following list describes the supported parameters:

- `slotId`: `string`

  The ID of the slot to fetch, optionally including a version in the form `<id>@<version>`.

- `options`: [`FetchOptions`](/reference/sdk/php/api/options/fetch-options) (optional)

  The fetch options, such as a fallback, preferred locale, version, or attributes.
