fetchContent
Learn how to fetch the content of a slot.
This method fetches the personalized content of a Slot to render in your application.
For more information, see the Content rendering reference.
Signature
This method has the following signature:
public function fetchContent(string $slotId, ?FetchOptions $options = null): FetchResponseThis method returns a FetchResponse with the resolved content. If the request fails and no fallback is set, it throws a CroctException.
Example
Here is a basic example of how to use this method:
<?phpuse Croct\Plug\Croct;
$croct = Croct::fromDotenv();$response = $croct->fetchContent('home-hero');Parameters
The following list describes the supported parameters: