GithubHelp home page GithubHelp logo

bob4081 / craft3-jsonclient Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dolphiq/craft3-jsonclient

0.0 0.0 0.0 18 KB

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

License: MIT License

PHP 100.00%

craft3-jsonclient's Introduction

Json Client plugin for Craft CMS 3.1.x

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.

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

    composer require dolphiq/jsonclient
    
  2. Install plugin in the Craft Control Panel under Settings > Plugins

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

Brought to you by Dolphiq

craft3-jsonclient's People

Contributors

brandonkelly avatar johanzandstra avatar kbergha avatar luuc15 avatar monachilada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.