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

🐕 A plugin for Craft CMS that adds data fetching for use in templates.

License

Notifications You must be signed in to change notification settings

craftplugins/fetch

Repository files navigation

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

About

🐕 A plugin for Craft CMS that adds data fetching for use in templates.

Topics

Resources

License

Stars

Watchers

Forks

Languages