I'm aiming to apply a specific class to each list item in the second UL based upon the list it appears on. The second json call returns an ID that matches the ID and name pair which can be found in the first list.
I'd like to have each listID assigned to a $variable called $listID with the value that is the name of that list.
eg $514fc8993f53cfb366006851 = "To Do";
I could then use an if statement to assign a class based upon a series of if statements in the second block of PHP.
Any help generating these variables would be greatly appreciated.
The relevant code is as follows:
<p>The sample board contains the following lists:</p>
<ul>
<?
$lists_enc = file_get_contents("https://api.trello.com/1/board/".$BOARD."/lists?key=9ee57574e9f968cedf9ac9964d2f7c4e");
$lists = json_decode($lists_enc, true);
$testing = array();
foreach ($lists as $list) {
$id = $list["id"];
$name = $list["name"];
echo "<li>".$name." (".$id.")</li>\n";
}
echo "</ul>";
?>
<p>The sample board contains the following cards:</p>
<ul>
<?
$cards_enc = file_get_contents("https://api.trello.com/1/board/".$BOARD."/cards?fields=name,idList&key=9ee57574e9f968cedf9ac9964d2f7c4e");
$cards = json_decode($cards_enc, true);
foreach ($cards as $card) {
echo "<li class=".$status.">".$card["name"]."</li>\n";
}
?>
</ul>