Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was 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

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /