Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Latest commit

 

History

History
48 lines (33 loc) · 969 Bytes

README.md

File metadata and controls

48 lines (33 loc) · 969 Bytes

Important

This plugin is no longer maintained.

We recommend using the (other) Fetch plugin instead.

Fetch plugin for Craft CMS

file_get_contents for Craft CMS templates.

Automatically decodes JSON.

Usage

There’s three ways to use Fetch.

Variable
{{ craft.fetch.getFileContents(svgAsset.url) }}
Function
{{ fetch(svgAsset.url) }}
Filter
{{ svgAsset.url|fetch }}

Parameters

It’s possible to pass parameters as a second argument.

{{ fetch(svgAsset.url, {
  cache: false
}) }}
Parameter Description Default
cache Whether to cache the contents. true
suppressErrors Whether to suppress any PHP Notices/Warnings/Errors. true