2017 © Pedro Peláez
 

craft-plugin jsonclient

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and return it to your Twig template.

image

dolphiq/jsonclient

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and return it to your Twig template.

  • Friday, December 15, 2017
  • by dolphiq
  • Repository
  • 2 Watchers
  • 9 Stars
  • 223 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 4 Open issues
  • 4 Versions
  • 106 % Grown

The README.md

Json Client plugin for Craft CMS 3.1.x

Currently the project is DISCONTINUED. However, feel free to fork it and continue its development!

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and use the result in your Twig template., (*1)

Requirements

  • Craft 3.1+
  • PHP 7.0+

Using the plugin

  1. Install it using composer or the plugin store.
  2. Do composer.json updates - see "Installing using composer"
  3. You can use it from your template

Using the plugin in your twig template

    {# Get a random Fact form chucknorris.io #}
    {% set jsonData = fetchJson({
      'url': 'https://api.chucknorris.io/jokes/random'
    }) %}

    {% if (jsonData) %}
      <h1>Fact of the day</h1>
      {{ jsonData.value }}
    {% endif %}

Installing using composer

  1. Go to the project craft folder in the terminal and run, (*2)

    composer require dolphiq/jsonclient, (*3)

  2. Install plugin in the Craft Control Panel under Settings > Plugins, (*4)

Roadmap

  • Create filters for xss scripts
  • Create more helper functions to parse the Json
  • Support multiple methods not only get
  • Provide a way to add the parameters separated from the uri

Contributors & Developers

  • Johan Zandstra - johan@dolphiq.nl
  • Knut Erik Berg-Hansen
  • Mike Pierce

Brought to you by Dolphiq, (*5)

The Versions

15/12 2017

dev-development

dev-development

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and return it to your Twig template.

  Sources   Download

MIT

The Requires

 

twig json cms craftcms craft-plugin craft craft3 jsonclient

15/12 2017

dev-master

9999999-dev

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and return it to your Twig template.

  Sources   Download

MIT

The Requires

 

twig json cms craftcms craft-plugin craft craft3 jsonclient

15/12 2017

1.0.1

1.0.1.0

Simple Json client plugin for Craft3 CMS. The plugin provides a simple Twig extension which allows you to fetch a Json url and return it to your Twig template.

  Sources   Download

MIT

The Requires

 

twig json cms craftcms craft-plugin craft craft3 jsonclient

08/06 2017

1.0.0

1.0.0.0

Json client plugin for Craft3 CMS

  Sources   Download

MIT

The Requires

 

json cms craftcms craft-plugin craft craft3 jsonclient