本文整理汇总了PHP中ContactsUtil::resolveStateLabelByLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP ContactsUtil::resolveStateLabelByLanguage方法的具体用法?PHP ContactsUtil::resolveStateLabelByLanguage怎么用?PHP ContactsUtil::resolveStateLabelByLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactsUtil
的用法示例。
在下文中一共展示了ContactsUtil::resolveStateLabelByLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveDisplayedValueForRelatedAttribute
/**
* Resolves value for related attribute
* @param string $attribute
* @param string $relatedAttribute
* @return string
*/
protected function resolveDisplayedValueForRelatedAttribute($attribute, $relatedAttribute)
{
if ($this->element instanceof LeadStateDropDownElement) {
$label = ContactsUtil::resolveStateLabelByLanguage($this->model->{$attribute}, Yii::app()->language);
return Yii::app()->format->text($label);
}
return $this->model->{$attribute}->{$relatedAttribute};
}
示例2: testResolveStateLabelByLanguage
/**
* @depends testGetContactStateLabelsKeyedByLanguageAndOrder
*/
public function testResolveStateLabelByLanguage()
{
$states = ContactState::getByName('Qualified');
$this->assertEquals('Qualified', ContactsUtil::resolveStateLabelByLanguage($states[0], 'en'));
$this->assertEquals('QualifiedFr', ContactsUtil::resolveStateLabelByLanguage($states[0], 'fr'));
$this->assertEquals('QualifiedDe', ContactsUtil::resolveStateLabelByLanguage($states[0], 'de'));
}
示例3: getLeadStateDataFromStartingStateLabelByLanguage
/**
* Get an array of states from the starting state onwards, id/translated label pairings of the
* existing contact states ordered by order.
* @param string $language
* @return array
*/
public static function getLeadStateDataFromStartingStateLabelByLanguage($language)
{
assert('is_string($language)');
$leadStatesData = array();
$states = ContactState::getAll('order');
$startingState = ContactsUtil::getStartingStateId();
foreach ($states as $state) {
if ($startingState == $state->id) {
break;
}
$state->name = ContactsUtil::resolveStateLabelByLanguage($state, $language);
$leadStatesData[] = $state;
}
return $leadStatesData;
}
示例4: renderControlNonEditable
/**
* Renders the noneditable dropdown content.
* Takes the model attribute value and converts it into the proper display value
* based on the corresponding dropdown display label.
* @return A string containing the element's content.
*/
protected function renderControlNonEditable()
{
$label = ContactsUtil::resolveStateLabelByLanguage($this->model->{$this->attribute}, Yii::app()->language);
return Yii::app()->format->text($label);
}