Created
February 21, 2018 18:53
-
-
Save zhabinka/1c1ce5cfd00ba7876ed193cc2d19ab18 to your computer and use it in GitHub Desktop.
Получение и вывод JSON из TV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [[json? &input=`dates` &id=`1`]] | |
<?php | |
$tv = $modx->getTemplateVar($input, '*', $id); | |
$obj=json_decode($tv[value]); | |
$values = $obj->fieldValue; | |
foreach ($values as $key => $value) { | |
$date = '<option value="' . $value->dates . '">' . $value->dates . '</option>'; | |
echo $date; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment