Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Pass data from yaml to php

Started by Luca Caputo 6 years ago · 0 replies · 331 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 Jerry Hunt, 4 days ago
2 74 7 hours ago
General · by pamtbaau, 12 hours ago
1 47 12 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 39 5 days ago