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


PHP ContactsUtil::resolveStateLabelByLanguage方法代碼示例

本文整理匯總了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};
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:14,代碼來源:LeadModelAttributeAndElementDataToMergeItem.php

示例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'));
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:10,代碼來源:ContactsUtilTest.php

示例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;
 }
開發者ID:KulturedKitsch,項目名稱:kulturedkitsch.info,代碼行數:21,代碼來源:LeadsUtil.php

示例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);
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:11,代碼來源:ContactStateDropDownElement.php


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