aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorTeddy Wing2013-10-01 02:23:14 -0400
committerTeddy Wing2013-10-01 02:23:14 -0400
commitfbcc4242e352ef50008b10d1bb52e88a14bce9ea (patch)
treeff3eb1a70aabac10d533faf83d13fa1c101e8529 /index.php
parent37037b1e70159b5214972d53d3cca8ca5a9b6b93 (diff)
downloadBoston-Food-Truck-Schedule-API-fbcc4242e352ef50008b10d1bb52e88a14bce9ea.tar.bz2
Only link if the truck has a website
If no website exists for the truck, don't wrap its name in an <a> tag to minimise confusion (previously the link would go to the current page which was misleading).
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/index.php b/index.php
index b57d6d4..6cbc25e 100644
--- a/index.php
+++ b/index.php
@@ -106,7 +106,11 @@ $schedule = $BostonFoodTrucks->schedule(array(
<?php foreach ($schedule['food_trucks'] as $truck): ?>
<tr>
<td class="company">
- <a href="<?= $truck['company_url'] ?>"><?= $truck['company'] ?></a>
+ <?php if ($truck['company_url']): ?>
+ <a href="<?= $truck['company_url'] ?>"><?= $truck['company'] ?></a>
+ <?php else: ?>
+ <?= $truck['company'] ?>
+ <?php endif; ?>
</td>
<td class="location">