当前位置: 首页>>代码示例>>PHP>>正文


PHP Phone::getPhoneThumbnail方法代码示例

本文整理汇总了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, ',', ' ') . ' &euro;</span> <span class="badge" style="background: #e74c3c;">' . $phone->promotionPrice . ' &euro;</span>';
        } else {
            echo '<span class="badge">' . number_format($phone->price, 2, ',', ' ') . ' &euro;</span>';
        }
        echo '</div>';
        echo '</div>';
    }
    ?>
				</div>
			</div>
		<?php 
} else {
开发者ID:HadrienX,项目名称:PhoneDeals,代码行数:31,代码来源:list.php

示例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&amp;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>
开发者ID:HadrienX,项目名称:PhoneDeals,代码行数:31,代码来源:product.php


注:本文中的Phone::getPhoneThumbnail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。