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


PHP Currency::getList方法代码示例

本文整理汇总了PHP中Currency::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::getList方法的具体用法?PHP Currency::getList怎么用?PHP Currency::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Currency的用法示例。


在下文中一共展示了Currency::getList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCurrencyList

 public function getCurrencyList()
 {
     return CHtml::listData(Currency::getList(), 'id', 'name');
 }
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:4,代码来源:Currency.php

示例2: getPriceLabel

 /**
  * Получение блока стоимостей объекта в разных валютах
  * @param string $attributeName
  * @return type
  */
 public function getPriceLabel($attributeName)
 {
     if (!$this->eavEnable || !$this->hasEavAttribute($attributeName) || empty($this->{$attributeName})) {
         return;
     }
     $html = '';
     $currentCurrency = $this->getCurrentCurrency();
     $currencyList = Currency::getList();
     foreach ($currencyList as $currency) {
         $price = $this->_getCurrencyPrice($this->{$attributeName}, $currency);
         $value = $this->_getPriceString($price, $currency);
         if ($currency->id == $currentCurrency->id) {
             $html .= '<span class="property_price currency_' . $currency->code . '">' . $value . '</span>';
         } else {
             $html .= '<span class="property_price currency_' . $currency->code . '" style="display: none">' . $value . '</span>';
         }
     }
     return $html;
 }
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:24,代码来源:RealtyItem.php

示例3:

?>

<?php 
echo $form->dropDownListGroup($model, 'supplier_id', ['widgetOptions' => ['data' => Supplier::getList(), 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'ajax' => ['type' => 'POST', 'url' => ['getLoadingAddressList'], 'update' => '#Order_loading_id', 'error' => "function(data){\n                    \$('#Order_loading_id').empty().html('<option value=\"\">Select supplier address</option>');\n                }"], 'empty' => 'Select supplier company']]]);
?>

<?php 
echo $form->dropDownListGroup($model, 'loading_id', ['widgetOptions' => ['data' => [], 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'empty' => 'Select supplier address']]]);
?>

<?php 
echo $form->dropDownListGroup($model, 'delivery_id', ['widgetOptions' => ['data' => DeliveryAddress::getList(), 'htmlOptions' => ['class' => 'span5', 'maxlength' => 9, 'empty' => 'Select delivery address']]]);
?>

<?php 
echo $form->dropDownListGroup($model, 'currency_id', ['widgetOptions' => ['data' => Currency::getList(), 'htmlOptions' => ['class' => 'span5', 'empty' => 'Select currency']]]);
?>

<?php 
echo $form->dropDownListGroup($model, 'temperature_id', ['widgetOptions' => ['data' => Temperature::getList(), 'htmlOptions' => ['class' => 'span5', 'empty' => 'Select temperature']]]);
?>

<?php 
echo $form->datePickerGroup($model, 'valid_date', ['widgetOptions' => ['options' => ['format' => 'yyyy-mm-dd', 'startDate' => '0d', 'autoclose' => true], 'htmlOptions' => ['class' => 'span5', 'placeholder' => 'Select date']]]);
?>

<?php 
echo $form->datePickerGroup($model, 'load_date', ['widgetOptions' => ['options' => ['format' => 'yyyy-mm-dd', 'startDate' => '0d', 'autoclose' => true], 'htmlOptions' => ['class' => 'span5', 'placeholder' => 'Select date']]]);
?>

<?php 
开发者ID:septembermd,项目名称:n1,代码行数:31,代码来源:_form.php

示例4: is_array

<?php

$value = is_array($model->{$attributeName}) ? implode(", ", $model->{$attributeName}) : $model->{$attributeName};
$model->{$attributeName} = $value;
if (!key_exists($attributeName, $model->range)) {
    $model->range[$attributeName] = array('from' => '', 'to' => '');
}
$inputFrom = $form->textFieldGroup($model, "range[{$attributeName}][from]", ['label' => false, 'widgetOptions' => ['htmlOptions' => ['placeholder' => $attr->label . ' от', 'name' => "filter[range][{$attributeName}][from]", 'id' => $attributeId]]]);
$inputTo = $form->textFieldGroup($model, "range[{$attributeName}][to]", ['label' => false, 'widgetOptions' => ['htmlOptions' => ['placeholder' => $attr->label . ' до', 'name' => "filter[range][{$attributeName}][to]", 'id' => $attributeId]]]);
?>

<?php 
if ($viewType != 'simple') {
    $currencyList = CHtml::listData(Currency::getList(), 'id', 'code');
    ?>
<div class="form-group">
    <div class="row">
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon currency-icon">
                    <i class="fa fa-<?php 
    echo key_exists($this->getCurrentCurrency(), $currencyList) ? $currencyList[$this->getCurrentCurrency()] : 'rub';
    ?>
"></i>
                </span>
                <?php 
    echo $inputFrom;
    ?>
            </div>
        </div><!-- /.col-sm-6 -->
        <div class="col-sm-6">
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:31,代码来源:_money.php


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