本文整理汇总了PHP中WPSC_Countries::get_currency方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSC_Countries::get_currency方法的具体用法?PHP WPSC_Countries::get_currency怎么用?PHP WPSC_Countries::get_currency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPSC_Countries
的用法示例。
在下文中一共展示了WPSC_Countries::get_currency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a WPSC_Currency object
*
* @access public
*
* @since 3.8.14
*
* @param string $code this currency's code, like "USD" for a U.S.A dollar, or "EUR" for a euro
* @param string $symbol the text symbol for this currency, like "$"
* @param string $symbol_html the HTML representation of the symbol, like "$"
* @param string $name the currency name, like "US Dollar" or "Euro"
*
* @return void
*/
public function __construct($code, $symbol = null, $symbol_html = null, $name = null)
{
// if all parameters are specified we are trying to make a new currency object
if (!empty($code) && ($symbol != null || $symbol_html != null || $name != null)) {
// Create a new currency object
$this->code = $code;
$this->symbol = $symbol;
$this->symbol_html = $symbol_html;
$this->name = $name;
} else {
// if only code is specified the constructor is typing to get the information about an existing currency
$wpsc_currency = WPSC_Countries::get_currency($code);
$this->code = $wpsc_currency->code;
$this->symbol = $wpsc_currency->symbol;
$this->symbol_html = $wpsc_currency->symbol_html;
$this->name = $wpsc_currency->name;
}
}