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


PHP AuxLib::dropdownForJson方法代碼示例

本文整理匯總了PHP中AuxLib::dropdownForJson方法的典型用法代碼示例。如果您正苦於以下問題:PHP AuxLib::dropdownForJson方法的具體用法?PHP AuxLib::dropdownForJson怎麽用?PHP AuxLib::dropdownForJson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AuxLib的用法示例。


在下文中一共展示了AuxLib::dropdownForJson方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionGetStageNames

 /**
  * Used to populate options of stage name dropdowns
  */
 public function actionGetStageNames($workflowId, $optional = 'true')
 {
     $stages = Workflow::getStagesByNumber($workflowId);
     if ($optional === 'true') {
         echo CJSON::encode(AuxLib::dropdownForJson(array('any' => Yii::t('app', 'Any')) + $stages));
     } else {
         echo CJSON::encode(AuxLib::dropdownForJson($stages));
     }
 }
開發者ID:shuvro35,項目名稱:X2CRM,代碼行數:12,代碼來源:WorkflowController.php

示例2: listOption

 public static function listOption($attributes, $name)
 {
     if ($attributes instanceof Fields) {
         $attributes = $attributes->getAttributes();
     }
     $data = array('name' => $name, 'label' => $attributes['attributeLabel']);
     if (isset($attributes['type']) && $attributes['type']) {
         $data['type'] = $attributes['type'];
     }
     if (isset($attributes['required']) && $attributes['required']) {
         $data['required'] = 1;
     }
     if (isset($attributes['readOnly']) && $attributes['readOnly']) {
         $data['readOnly'] = 1;
     }
     if (isset($attributes['type'])) {
         if ($attributes['type'] === 'assignment' || $attributes['type'] === 'optionalAssignment') {
             $data['options'] = AuxLib::dropdownForJson(X2Model::getAssignmentOptions(true, true));
         } elseif ($attributes['type'] === 'dropdown' && isset($attributes['linkType'])) {
             $data['linkType'] = $attributes['linkType'];
             $data['options'] = AuxLib::dropdownForJson(Dropdowns::getItems($attributes['linkType']));
         } elseif ($attributes['type'] === 'link' && isset($attributes['linkType'])) {
             $staticLinkModel = X2Model::model($attributes['linkType']);
             if (array_key_exists('X2LinkableBehavior', $staticLinkModel->behaviors())) {
                 $data['linkType'] = $attributes['linkType'];
                 $data['linkSource'] = Yii::app()->controller->createUrl($staticLinkModel->autoCompleteSource);
             }
         }
     }
     return $data;
 }
開發者ID:tymiles003,項目名稱:X2CRM,代碼行數:31,代碼來源:X2ConditionList.php

示例3: actionGetFields

 public function actionGetFields($model)
 {
     if (!class_exists($model)) {
         echo 'false';
         return;
     }
     $fieldModels = X2Model::model($model)->getFields();
     $fields = array();
     foreach ($fieldModels as &$field) {
         if ($field->isVirtual) {
             continue;
         }
         $data = array('name' => $field->fieldName, 'label' => $field->attributeLabel, 'type' => $field->type);
         if ($field->required) {
             $data['required'] = 1;
         }
         if ($field->readOnly) {
             $data['readOnly'] = 1;
         }
         if ($field->type === 'assignment' || $field->type === 'optionalAssignment') {
             $data['options'] = AuxLib::dropdownForJson(X2Model::getAssignmentOptions(true, true));
         } elseif ($field->type === 'dropdown') {
             $data['linkType'] = $field->linkType;
             $data['options'] = AuxLib::dropdownForJson(Dropdowns::getItems($field->linkType));
         }
         if ($field->type === 'link') {
             $staticLinkModel = X2Model::model($field->linkType);
             if (array_key_exists('X2LinkableBehavior', $staticLinkModel->behaviors())) {
                 $data['linkType'] = $field->linkType;
                 $data['linkSource'] = Yii::app()->controller->createUrl($staticLinkModel->autoCompleteSource);
             }
         }
         $fields[] = $data;
     }
     echo CJSON::encode($fields);
 }
開發者ID:keyeMyria,項目名稱:CRM,代碼行數:36,代碼來源:StudioController.php


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