本文整理汇总了PHP中i18n::money_format方法的典型用法代码示例。如果您正苦于以下问题:PHP i18n::money_format方法的具体用法?PHP i18n::money_format怎么用?PHP i18n::money_format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类i18n
的用法示例。
在下文中一共展示了i18n::money_format方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_get
public function action_get()
{
try {
if (is_numeric($id_ad = $this->request->param('id'))) {
$ad = new Model_Ad($id_ad);
if ($ad->loaded()) {
if ($ad->id_user == $this->user->id_user) {
$a = $ad->as_array();
$a['price'] = i18n::money_format($ad->price);
$a['images'] = array_values($ad->get_images());
$a['category'] = $ad->category->as_array();
$a['location'] = $ad->location->as_array();
$a['customfields'] = Model_Field::get_by_category($ad->id_category);
$this->rest_output(array('ad' => $a));
} else {
$this->_error(__('Not your advertisement'), 401);
}
} else {
$this->_error(__('Advertisement not found'), 404);
}
} else {
$this->_error(__('Advertisement not found'), 404);
}
} catch (Kohana_HTTP_Exception $khe) {
$this->_error($khe);
return;
}
}
示例2: action_get
public function action_get()
{
try {
if (is_numeric($id_category = $this->request->param('id'))) {
$cat = array();
$category = new Model_Category($id_category);
if ($category->loaded()) {
$cat = $category->as_array();
$cat['price'] = i18n::money_format($category->price);
$cat['parents'] = $category->get_parents_ids();
$cat['siblings'] = $category->get_siblings_ids();
$cat['customfields'] = Model_Field::get_by_category($category->id_category);
$cat['icon'] = $category->get_icon();
$this->rest_output(array('category' => $cat));
} else {
$this->_error(__('Category not found'), 404);
}
} else {
$this->_error(__('Category not found'), 404);
}
} catch (Kohana_HTTP_Exception $khe) {
$this->_error($khe);
return;
}
}
示例3: action_get
public function action_get()
{
try {
if (is_numeric($id_ad = $this->request->param('id'))) {
$ad = new Model_Ad();
//get distance to the ad
if (isset($this->_params['latitude']) and isset($this->_params['longitude'])) {
$ad->select(array(DB::expr('degrees(acos(sin(radians(' . $this->_params['latitude'] . ')) * sin(radians(`latitude`)) + cos(radians(' . $this->_params['latitude'] . ')) * cos(radians(`latitude`)) * cos(radians(abs(' . $this->_params['longitude'] . ' - `longitude`))))) * 69.172'), 'distance'));
}
$ad->where('id_ad', '=', $id_ad)->where('status', '=', Model_Ad::STATUS_PUBLISHED)->cached()->find();
if ($ad->loaded()) {
$a = $ad->as_array();
$a['price'] = i18n::money_format($ad->price);
$a['images'] = array_values($ad->get_images());
$a['category'] = $ad->category->as_array();
$a['location'] = $ad->location->as_array();
$a['user'] = Controller_Api_Users::get_user_array($ad->user);
$a['customfields'] = Model_Field::get_by_category($ad->id_category);
//sorting by distance, lets add it!
if (isset($ad->distance)) {
$a['distance'] = i18n::format_measurement($ad->distance);
}
$a['url'] = Route::url('ad', array('category' => $ad->category->seoname, 'seotitle' => $ad->seotitle));
$this->rest_output(array('ad' => $a));
} else {
$this->_error(__('Advertisement not found'), 404);
}
} else {
$this->_error(__('Advertisement not found'), 404);
}
} catch (Kohana_HTTP_Exception $khe) {
$this->_error($khe);
return;
}
}
示例4: __
<td class="text-right"><h4><strong><?php
echo __('Total');
?>
: </strong></h4></td>
<?php
if ($order->id_product == Model_Order::PRODUCT_AD_SELL and isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
?>
<td class="text-center text-danger"><h4><strong><?php
echo i18n::money_format($order->amount + $order->ad->cf_shipping, $order->currency);
?>
</strong></h4></td>
<?php
} else {
?>
<td class="text-center text-danger"><h4><strong><?php
echo $order->id_product == Model_Order::PRODUCT_AD_SELL ? i18n::money_format($order->amount, $order->currency) : i18n::format_currency($order->amount, $order->currency);
?>
</strong></h4></td>
<?php
}
?>
</tr>
<tr>
<td></td>
<td class="text-right">
<?php
if (!core::get('print')) {
?>
<div class="pull-right">
<a target="_blank" class="btn btn-xs btn-success" title="<?php
echo __('Print this');
示例5: array
<?php
echo FORM::input('affiliate_percentage', Request::current()->post('affiliate_percentage'), array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'affiliate_percentage', 'type' => 'text'));
?>
</div>
</div>
<?php
}
?>
<div class="form-group">
<?php
echo FORM::label('price_offer', __('Price Offer'), array('class' => 'col-md-12 ', 'for' => 'price_offer'));
?>
<div class="col-md-12">
<?php
echo FORM::input('price_offer', Request::current()->post('price_offer'), array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'price_offer', 'type' => 'text'));
?>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label('offer_valid', __('Offer Valid'), array('class' => 'col-md-12', 'for' => 'offer_valid'));
?>
<div class="col-md-8">
<div class="input-group">
<input type="text" size="16" id="offer_valid" name="offer_valid" value="" class="form-control " data-date="" data-date-format="yyyy-mm-dd">
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
</div>
</div>
</div>
示例6: array
<li>
<a href="<?php
echo Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order));
?>
?featured_days=<?php
echo $days;
?>
">
<small><?php
echo $days;
?>
<?php
echo __('Days');
?>
- <?php
echo i18n::money_format($price);
?>
</small>
</a>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
}
?>
</td>
示例7: _e
?>
</div>
</div>
<?php
}
?>
<?php
if (core::config('advertisement.price') != FALSE) {
?>
<div class="col-xs-6">
<?php
echo FORM::label('price', _e('Price'), array('class' => '', 'for' => 'price'));
?>
<div class="input-prepend">
<?php
echo FORM::input('price', i18n::format_currency_without_symbol($ad->price), array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control fc-small', 'id' => 'price', 'data-error' => __('Please enter only numbers.')));
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
<!-- END PRICE AND STOCK -->
<!-- START DESCRIPTION -->
<?php
if (core::config('advertisement.description') != FALSE) {
示例8: __
</div>
</div>
<?php
}
?>
<?php
if (core::config('advertisement.price') != FALSE) {
?>
<div class="form-group">
<div class="col-sm-8">
<?php
echo FORM::label('price', __('Price'), array('class' => '', 'for' => 'price'));
?>
<div class="input-prepend">
<?php
echo FORM::input('price', $ad->price, array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price', 'data-error' => __('Please enter only numbers.')));
?>
</div>
</div>
</div>
<?php
}
?>
<?php
if (core::config('advertisement.website') != FALSE) {
?>
<div class="form-group">
<div class="col-sm-8">
<?php
echo FORM::label('website', __('Website'), array('class' => '', 'for' => 'website'));
?>
示例9: lili3
function lili3($item, $key, $cats)
{
?>
<div class="accordion-group">
<div class="accordion-heading">
<?php
if (count($item) > 0) {
?>
<label class="radio">
<a class="btn btn-primary btn-xs" data-toggle="collapse" type="button"
data-target="#acc_<?php
echo $cats['categories'][$key]['seoname'];
?>
">
<i class=" glyphicon glyphicon-plus"></i> <?php
echo $cats['categories'][$key]['name'];
?>
</a>
<input <?php
echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'checked' : '';
?>
type="radio" id="radio_<?php
echo $cats['categories'][$key]['seoname'];
?>
" name="category" value="<?php
echo $cats['categories'][$key]['id'];
?>
" required >
<?php
if ($cats['categories'][$key]['price'] > 0) {
?>
<span class="label label-success">
<?php
echo i18n::money_format($cats['categories'][$key]['price']);
?>
</span>
<?php
}
?>
</label>
<?php
} else {
?>
<label class="radio">
<input class="ml-10" <?php
echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'checked' : '';
?>
type="radio" id="radio_<?php
echo $cats['categories'][$key]['seoname'];
?>
" name="category" value="<?php
echo $cats['categories'][$key]['id'];
?>
" required >
<a class="btn btn-xs btn-primary ml-10" data-toggle="collapse" type="button"
data-target="#acc_<?php
echo $cats['categories'][$key]['seoname'];
?>
">
<?php
echo $cats['categories'][$key]['name'];
?>
</a>
<?php
if ($cats['categories'][$key]['price'] > 0) {
?>
<span class="label label-success">
<?php
echo i18n::money_format($cats['categories'][$key]['price']);
?>
</span>
<?php
}
?>
</label>
<?php
}
?>
</div>
<?php
if (count($item) > 0) {
?>
<div id="acc_<?php
echo $cats['categories'][$key]['seoname'];
?>
"
class="accordion-body collapse <?php
echo $cats['categories'][$key]['seoname'] == $cats['cat_selected'] ? 'in' : '';
?>
">
<div class="accordion-inner">
<?php
if (is_array($item)) {
array_walk($item, 'lili3', $cats);
}
?>
</div>
</div>
<?php
}
//.........这里部分代码省略.........
示例10: __
?>
<?php
}
?>
<?php
if ($form_show['price'] != FALSE) {
?>
<div class="form-group">
<div class="col-md-4">
<?php
echo FORM::label('price', __('Price'), array('for' => 'price'));
?>
<div class="input-prepend">
<?php
echo FORM::input('price', Request::current()->post('price'), array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price', 'type' => 'text', 'data-error' => __('Please enter only numbers.')));
?>
</div>
</div>
</div>
<?php
}
?>
<?php
if (core::config('payment.stock')) {
?>
<div class="form-group">
<div class="col-md-4">
<?php
echo FORM::label('stock', __('In Stock'), array('for' => 'stock'));
示例11: array
<?php
echo FORM::input('affiliate_percentage', $product->affiliate_percentage, array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'affiliate_percentage', 'type' => 'text'));
?>
</div>
</div>
<?php
}
?>
<div class="form-group">
<?php
echo FORM::label('price_offer', __('Price Offer'), array('class' => 'col-md-12', 'for' => 'price_offer'));
?>
<div class="col-md-12">
<?php
echo FORM::input('price_offer', $product->price_offer, array('placeholder' => i18n::money_format(1), 'class' => 'form-control', 'id' => 'price_offer', 'type' => 'text'));
?>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label('offer_valid', __('Offer Valid'), array('class' => 'col-md-12', 'for' => 'offer_valid'));
?>
<div class="col-md-8">
<div class="input-group">
<input type="text" size="16" id="offer_valid" name="offer_valid" value="<?php
echo $product->offer_valid != NULL ? Date::format($product->offer_valid, 'Y-m-d') : '';
?>
" class="form-control" data-date="" data-date-format="yyyy-mm-dd">
<div class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></div>
示例12: _e
<?php
if (Model_Coupon::current()->loaded()) {
?>
<?php
echo Form::hidden('coupon_delete', Model_Coupon::current()->name);
?>
<button type="submit" class="btn btn-warning"><?php
echo _e('Delete');
?>
<?php
echo Model_Coupon::current()->name;
?>
</button>
<p>
<?php
echo sprintf(__('Discount off %s'), Model_Coupon::current()->discount_amount == 0 ? round(Model_Coupon::current()->discount_percentage, 0) . '%' : i18n::money_format(Model_Coupon::current()->discount_amount));
?>
<br>
<?php
echo sprintf(__('%s coupons left'), Model_Coupon::current()->number_coupons);
?>
, <?php
echo sprintf(__('valid until %s'), Date::format(Model_Coupon::current()->valid_date, core::config('general.date_format')));
?>
.
<?php
if (Model_Coupon::current()->id_product != NULL) {
?>
<?php
echo sprintf(__('only valid for %s'), Model_Order::product_desc(Model_Coupon::current()->id_product));
?>
示例13: __
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group ">
<div class="col-sm-12">
<label for="discount_amount" class="control-label"><?php
echo __('Discount Amount');
?>
</label>
<input type="text" id="discount_amount" name="discount_amount" value="" placeholder="<?php
echo html_entity_decode(i18n::money_format(1));
?>
" />
</div>
</div>
<div class="form-group hidden">
<div class="col-sm-12">
<label for="discount_percentage" class="control-label"><?php
echo __('Discount Percentage');
?>
</label>
<input type="text" id="discount_percentage" name="discount_percentage" value="" />
</div>
</div>
<div class="form-group ">
示例14: array
?>
<?php
echo FORM::input('website', $ad->website, array('class' => 'form-control', 'id' => 'website', 'placeholder' => __('Website')));
?>
</div>
</div>
<?endif?>
<?if(core::config('advertisement.price') != FALSE):?>
<div class="form-group">
<div class="col-sm-8">
<?php
echo FORM::label('price', __('Price'), array('class' => '', 'for' => 'price'));
?>
<div class="input-prepend">
<?php
echo FORM::input('price', $ad->price, array('placeholder' => html_entity_decode(i18n::money_format(1)), 'class' => 'form-control', 'id' => 'price'));
?>
</div>
</div>
</div>
<?endif?>
<!-- Fields coming from custom fields feature -->
<?if (Theme::get('premium')==1):?>
<div id="custom-fields" data-customfield-values='<?php
echo json_encode($ad->custom_columns());
?>
'>
<div id="custom-field-template" class="form-group hidden">
<div class="col-sm-8">
<div data-label></div>
<div data-input></div>
示例15: echo
<?php
echo ($product_desc = Model_Order::product_desc($element->id_product)) == '' ? __('Any') : $product_desc;
?>
<?php
} else {
?>
<?php
echo $element->id_product;
?>
<?php
}
?>
</td>
<td>
<?php
echo $element->discount_amount == 0 ? round($element->discount_percentage, 0) . '%' : i18n::money_format($element->discount_amount);
?>
</td>
<td><?php
echo $element->number_coupons;
?>
</td>
<td><?php
echo Date::format($element->valid_date, core::config('general.date_format'));
?>
</td>
<td><?php
echo Date::format($element->created, core::config('general.date_format'));
?>
</td>