Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Pass data from yaml to php

Started by Luca Caputo 6 years ago · 0 replies · 515 views
6 years ago

hi everyone, I have a yaml file which returns an API. like this in example:

MYAPI: "https://prova1api.herokuapp.com/RedHotCHiliPeppersDiscography"

I would like to take MYAPI and pass it in a php file, like this in example:

$ api_data = json_decode ($ MYAPI, true);
$ this-> grav ['twig'] -> twig_vars ['api_data'] = $ api_data;

last edited 07/23/20 by Luca Caputo

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 4 days ago
3 92 1 hour ago
General · by Old Man Umby, 2 days ago
1 60 2 days ago
General · by Sebastian, 4 days ago
1 81 4 days ago
General · by Andy Miller, 2 weeks ago
0 216 2 weeks ago
General · by ready-4-IT, 6 months ago
1 716 3 weeks ago