本文整理汇总了PHP中XLite\Core\Translation::translateWeightSymbol方法的典型用法代码示例。如果您正苦于以下问题:PHP Translation::translateWeightSymbol方法的具体用法?PHP Translation::translateWeightSymbol怎么用?PHP Translation::translateWeightSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Translation
的用法示例。
在下文中一共展示了Translation::translateWeightSymbol方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatModifierWeight
/**
* Format modifier weight
*
* @param float $value Value
*
* @return string
*/
public static function formatModifierWeight($value)
{
return $value . ' ' . \XLite\Core\Translation::translateWeightSymbol();
}
示例2: getWeightSymbol
/**
* Get translated weight symbol
*
* @return string
*/
protected function getWeightSymbol()
{
return \XLite\Core\Translation::translateWeightSymbol();
}
示例3: getTestRatesSchema
/**
* Get fields for schema
*
* @return array
*/
protected function getTestRatesSchema()
{
$result = $this->schemaTestRates;
$fields = $this->getAvailableSchemaFields();
// Add separators
$separators = $this->getSchemaFieldsSubsections();
foreach ($separators as $k => $v) {
if (array_intersect($v, $fields)) {
$fields[] = $k;
}
}
// Add custom state fields
if (in_array(static::SCHEMA_FIELD_SRC_STATE, $fields)) {
$fields[] = static::SCHEMA_FIELD_SRC_CUSTOM_STATE;
}
if (in_array(static::SCHEMA_FIELD_DST_STATE, $fields)) {
$fields[] = static::SCHEMA_FIELD_DST_CUSTOM_STATE;
}
// Get list of schema fields
if ($fields) {
foreach ($result as $k => $v) {
if (!in_array($k, $fields)) {
unset($result[$k]);
} else {
if (self::SCHEMA_FIELD_WEIGHT === $k) {
$result[$k][self::SCHEMA_LABEL_PARAMS] = array('units' => \XLite\Core\Translation::translateWeightSymbol());
} elseif (self::SCHEMA_FIELD_SUBTOTAL === $k) {
$result[$k][self::SCHEMA_LABEL_PARAMS] = array('units' => \XLite::getInstance()->getCurrency()->getSymbol());
}
}
}
}
return $result;
}