Created
October 3, 2016 21:00
-
-
Save Rachind/ec653a5d03cec8aaa8681ea7bd8be5ba to your computer and use it in GitHub Desktop.
MODX create MIGX tv value
This file contains hidden or 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
<? | |
$pics = array(); | |
$i = 1; | |
foreach ($api_value->animalPictures as $animalPictures) { | |
$pic = array(); | |
$pic['image'] = $animalPictures->urlSecureFullsize; | |
$pic['MIGX_id'] = $i; | |
$pics[] = $pic; | |
$i++; | |
} | |
if (!$page->setTVValue('pet_pictures', $modx->toJson($pics))) { | |
$modx->log(modX::LOG_LEVEL_ERROR, 'There was a problem saving your TV animalPictures!'); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment