當前位置: 首頁>>代碼示例>>PHP>>正文


PHP i18n::format_measurement方法代碼示例

本文整理匯總了PHP中i18n::format_measurement方法的典型用法代碼示例。如果您正苦於以下問題:PHP i18n::format_measurement方法的具體用法?PHP i18n::format_measurement怎麽用?PHP i18n::format_measurement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在i18n的用法示例。


在下文中一共展示了i18n::format_measurement方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

</h4>
					</div>
					<div class="modal-body">
						<div class="list-group">
							<?php 
        foreach ($auto_locats as $loc) {
            ?>
								<a href="<?php 
            echo Route::url('default');
            ?>
" class="list-group-item" data-id="<?php 
            echo $loc->id_location;
            ?>
"><span class="pull-right"><span class="glyphicon glyphicon-chevron-right"></span></span> <?php 
            echo $loc->name;
            ?>
 (<?php 
            echo i18n::format_measurement($loc->distance);
            ?>
)</a>
							<?php 
        }
        ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	<?php 
    }
}
開發者ID:ThomWensink,項目名稱:openclassifieds2,代碼行數:31,代碼來源:home.php

示例2: 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);
     }
 }
開發者ID:johnulist,項目名稱:openclassifieds2,代碼行數:34,代碼來源:listings.php

示例3: http_build_query

        <div class="btn-group pull-right">
            <button
                class="btn btn-sm btn-default <?php 
        echo core::request('userpos') == 1 ? 'active' : NULL;
        ?>
"
                id="myLocationBtn"
                type="button"
                data-toggle="modal"
                data-target="#myLocation"
                data-href="?<?php 
        echo http_build_query(['userpos' => 1] + Request::current()->query());
        ?>
">
                <i class="glyphicon glyphicon-map-marker"></i> <?php 
        echo sprintf(__('%s from you'), i18n::format_measurement(Core::config('advertisement.auto_locate_distance', 1)));
        ?>
            </button>
        </div>
        <div class="clearfix"></div>
    <?php 
    }
    ?>
 <!-- Case when we dont have ads for specific category / location -->
  <div class="page-header">
      <h3><?php 
    echo __('We do not have any advertisements in this category');
    ?>
</h3>
  </div>
<?php 
開發者ID:Chinese1904,項目名稱:openclassifieds2,代碼行數:31,代碼來源:listing.php

示例4: array

                                </li>
                                <li>
                                    <a href="#" data-value="50"><?php 
    echo i18n::format_measurement(50);
    ?>
</a>
                                </li>
                                <li>
                                    <a href="#" data-value="250"><?php 
    echo i18n::format_measurement(250);
    ?>
</a>
                                </li>
                                <li>
                                    <a href="#" data-value="500"><?php 
    echo i18n::format_measurement(500);
    ?>
</a>
                                </li>
                            </ul>
                        </div>
                        <input type="hidden" name="distance" id="myDistance" value="<?php 
    echo Core::cookie('mydistance', Core::config('advertisement.auto_locate_distance', 2));
    ?>
" disabled>
                        <input type="hidden" name="latitude" id="myLatitude" value="" disabled>
                        <input type="hidden" name="longitude" id="myLongitude" value="" disabled>
                        <?php 
    echo FORM::input('myAddress', Request::current()->post('address'), array('class' => 'form-control', 'id' => 'myAddress', 'placeholder' => __('Where do you want to search?')));
    ?>
                        <span class="input-group-btn">
開發者ID:ThomWensink,項目名稱:openclassifieds2,代碼行數:31,代碼來源:listing.php


注:本文中的i18n::format_measurement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。