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

Pass data from yaml to php

Started by Luca Caputo 6 years ago · 0 replies · 391 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 Hanns Mattes, 3 weeks ago
1 271 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 196 3 weeks ago
General · by Jerry Hunt, 3 weeks ago
2 334 3 weeks ago
General · by pamtbaau, 3 weeks ago
1 253 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 228 3 weeks ago