hasFallback

Learn how to check whether a fallback was set.

This method checks whether a fallback value has been set for the content.

Signature

This method has the following signature:

public function hasFallback(): bool

This method returns true when a fallback has been set, or false otherwise (the default).

Example

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

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