本文整理汇总了PHP中Phone::getPhoneThumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP Phone::getPhoneThumbnail方法的具体用法?PHP Phone::getPhoneThumbnail怎么用?PHP Phone::getPhoneThumbnail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phone
的用法示例。
在下文中一共展示了Phone::getPhoneThumbnail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
</div>
<?php
if (!isset($_GET['p']) || $_GET['p'] < $totalPages + 1) {
?>
<div class="col-md-9">
<div class="row">
<?php
foreach ($phoneRequest as $phone) {
if (Promotion::getPromotionByPhoneId($phone->id)) {
$phone->promotionPrice = $phone->price - Promotion::getPromotionByPhoneId($phone->id)->percent * 0.01 * $phone->price;
}
echo '<div class="col-md-4 col-sm-6 col-xs-12" style="text-align: center">';
echo '<div style="border: 1px solid #ededed; padding: 30px; margin: 20px 0;">';
echo '<a href="index.php?page=product&id=' . $phone->id . '">';
echo '<img src="' . Phone::getPhoneThumbnail($phone->id) . '" alt="' . $phone->name . '" style="width: 100px;">';
echo '<h4>' . $phone->name . '</h4>';
echo '</a>';
if (isset($phone->promotionPrice)) {
echo '<span class="badge old-price" style="background-color: transparent; height: 18px; color: #777;">' . number_format($phone->price, 2, ',', ' ') . ' €</span> <span class="badge" style="background: #e74c3c;">' . $phone->promotionPrice . ' €</span>';
} else {
echo '<span class="badge">' . number_format($phone->price, 2, ',', ' ') . ' €</span>';
}
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
<?php
} else {
示例2: explode
<h1 style="margin-bottom: 0;"><?php
echo $phone->name;
?>
</h1>
<span style="color: #bfbfbf; display: block; font-size: 18px;"><?php
echo $brand->name;
?>
</span>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="index.php?page=product&id=<?php
echo $phone->id;
?>
" style="display: inline-block; padding: 15px; border: 1px solid #ededed;">
<img id="phone_img" src="<?php
echo Phone::getPhoneThumbnail($phone->id);
?>
" alt="<?php
echo $phone->name;
?>
" style="width: 300px;">
</a>
<div id="phone-colors" style="text-align: center; margin-top: 15px;">
<?php
$colors = explode(',', $phone->color);
foreach ($colors as $color) {
$c = Color::getColorById($color);
echo '<div class="color" style="width:20px; height:20px; display: inline-block; border-radius: 20px; margin-right:5px; background-color:' . $c->hex . '; border:solid 1px silver;" onmouseover="this.style.cursor=\'pointer\';" onmouseout="this.style.cursor=\'\';" value="' . $c->id . '" title="' . $c->name . '"></div>';
}
?>
</div>