getFallback

Learn how to get the fallback value for the content.

This method provides the fallback value used when the content cannot be fetched.

Signature

This method has the following signature:

public function getFallback(): mixed

This method returns the fallback value, or null by default.

Example

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

<?phpuse Croct\Plug\FetchOptions;
$options = FetchOptions::defaults()->withFallback(['title' => 'Welcome']);$fallback = $options->getFallback();