本文整理汇总了PHP中Format::price方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::price方法的具体用法?PHP Format::price怎么用?PHP Format::price使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::price方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<h3>Заказы клиента</h3>
<?php
// Create table body
$table_body = [];
foreach ($orders as $o) {
$table_body[] = [$o->id, HTML::anchor(Route::url('b_shop', ['controller' => 'orders', 'action' => 'edit', 'id' => $o->id]), '№' . $o->number, ['data-toggle' => 'tooltip', 'data-original-title' => 'Редактировать заказ']), Format::price($o->total), Date::format($o->created, Date::FULL), $o->status->get_title(), TB::act($request->routename, ['controller' => $request->controller, 'action' => 'edit', 'id' => $o->id]) . TB::act($request->routename, ['controller' => $request->controller, 'action' => 'delete', 'id' => $o->id])];
}
// Create table
echo TB_Table::open();
echo TB_Table::colgroup([50, 100, 0, 0, 0]);
echo TB_Table::headers_sorter(['id' => ['string', __('#ID')], 'number' => ['string', __('Номер')], 'total' => ['string', __('Сумма')], 'created' => ['string', __('Дата заказа')], '_status' => ['none', __('Статус')], '_action' => ['none', __('settings.actions')]]);
echo TB_Table::body($table_body);
echo TB_Table::close();
?>
<span class="badge badge-info">
Заказов: <?php
echo $total_items;
?>
</span>
<br>
<span class="badge badge-info">
Cумма заказов: <?php
echo Format::price($total_sum);
?>
</span>
</div>
</div>
示例2:
$i++;
?>
<?php
}
?>
<tr>
<td> </td>
<td>
<button type="submit" class="btn btn-default">
<i class="fa fa-refresh fa-fw"></i>
Пересчитать
</button>
</td>
<td class="text-right"><h4>Итого:</h4></td>
<td class="text-right"><h4><?php
echo Format::price($cart->total());
?>
</h4></td>
<td> </td>
</tr>
<tr>
<td class="text-right" colspan="5">
<a href="<?php
echo Route::url('f_cart', ['action' => 'checkout']);
?>
" class="btn btn-success btn-lg">
Оформление заказа
</a>
</td>
</tr>
</table>
示例3: defined
<?php
defined('SYSPATH') or die('No direct script access.');
if ($total_items > 0) {
// Create table body
$table_body = [];
foreach ($obj as $o) {
$table_body[] = [HTML::anchor(Route::url('b_shop', ['controller' => 'orders', 'action' => 'edit', 'id' => $o->id]), '№' . $o->number, ['data-toggle' => 'tooltip', 'data-original-title' => 'Редактировать заказ']), Format::price($o->total), Date::format($o->created, Date::FULL), $o->status->get_title(), HTML::anchor(Route::url('b_shop', ['controller' => 'customers', 'action' => 'view', 'id' => $o->customer->id]), $o->customer->fio, ['data-toggle' => 'tooltip', 'data-original-title' => 'Профиль и заказы клиента']), Format::mobile($o->customer->phone), TB::act($request->routename, ['controller' => $request->controller, 'action' => 'edit', 'id' => $o->id]) . TB::act($request->routename, ['controller' => $request->controller, 'action' => 'delete', 'id' => $o->id])];
}
// Create table
echo TB_Table::open();
echo TB_Table::colgroup([100, 0, 0, 0, 0, 0, 0]);
echo TB_Table::headers_sorter(['number' => ['string', __('Номер')], 'total' => ['string', __('Сумма')], 'created' => ['string', __('Дата заказа')], '_status' => ['none', __('Статус')], '_fio' => ['none', __('Клиент')], '_phone' => ['none', __('Телефон')], '_action' => ['none', __('settings.actions')]]);
echo TB_Table::body($table_body);
echo TB_Table::close();
echo '<span class="badge badge-info">Всего заказов: ' . $total_items . '</span>';
if (isset($pg)) {
echo $pg;
}
} else {
?>
<div class="alert alert-block alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
Заказов нет.
</div>
<?php
}
示例4:
</td>
<td><?php
echo $product->qty;
?>
</td>
<td><?php
echo Format::price($product->price);
?>
</td>
<td><?php
echo Format::price($product->subtotal);
?>
</td>
</tr>
<?php
}
?>
<tr>
<td> </td>
<td> </td>
<td style="white-space: nowrap;"><h4>Сумма заказа</h4></td>
<td><h4><?php
echo Format::price($obj->total);
?>
</h4></td>
</tr>
</table>
</div>
</div>
示例5: foreach
<th>Статус</th>
<th>Клиент</th>
<th>Телефон</th>
<th>Действия</th>
</tr>
<?php
foreach ($obj_orders as $order) {
?>
<tr>
<td>
<?php
echo HTML::anchor(Route::url('b_shop', ['controller' => 'orders', 'action' => 'edit', 'id' => $order->id]), '№' . $order->number, ['data-toggle' => 'tooltip', 'data-original-title' => 'Редактировать заказ']);
?>
</td>
<td><?php
echo Format::price($order->total);
?>
</td>
<td><?php
echo Date::format($order->created, Date::FULL);
?>
</td>
<td><?php
echo $order->status->get_title();
?>
</td>
<td>
<?php
echo HTML::anchor(Route::url('b_shop', ['controller' => 'customers', 'action' => 'view', 'id' => $order->customer->id]), $order->customer->fio, ['data-toggle' => 'tooltip', 'data-original-title' => 'Профиль и заказы клиента']);
?>
</td>