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


PHP ActiveRecord::attributeLabels方法代碼示例

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


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

示例1: attributeLabels

 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     //        return [
     //            'id' => Yii::t('reportmanager', 'ID'),
     //        ];
     return ArrayHelper::map(self::$report->columns, 'alias', 'label') + parent::attributeLabels();
 }
開發者ID:VEKsoftware,項目名稱:yii2-report-manager,代碼行數:10,代碼來源:ClassSearch.php

示例2: attributeLabels

 /**
  * Get labels from behavior relations
  * @return array
  */
 public function attributeLabels()
 {
     if ($this->_labels === null) {
         $this->_labels = [];
         foreach ($this->behaviors as $behavior) {
             if ($behavior instanceof HasRelation) {
                 $this->_labels[$behavior->getAttributeName()] = $behavior->getAttributeLabel();
             }
         }
     }
     return array_merge(parent::attributeLabels(), $this->_labels);
 }
開發者ID:NullRefExcep,項目名稱:yii2-core,代碼行數:16,代碼來源:Model.php

示例3: attributeLabels

 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     $labels = parent::attributeLabels();
     $labels['id'] = 'ID';
     $labels['lft'] = 'Левый край диапазона';
     $labels['rgt'] = 'Правый край диапазона';
     $labels['depth'] = 'Уровень';
     $labels['name'] = 'Название';
     $labels['title'] = 'Заголовок';
     $labels['alias'] = 'Алиас';
     $labels['template_id'] = 'Шаблон';
     $labels['annotation'] = 'Аннотация';
     $labels['meta_description'] = 'Мета-описание';
     $labels['meta_keywords'] = 'Мета-ключи';
     $labels['content'] = 'Содержание';
     $labels['img'] = 'Изображение';
     $labels['status'] = 'Статус';
     $labels['created_at'] = 'Создан';
     $labels['updated_at'] = 'Обновлен';
     $labels['created_user_id'] = 'Создал';
     $labels['updated_user_id'] = 'Обновил';
     $labels['created_user_name'] = 'Создал';
     $labels['updated_user_name'] = 'Обновил';
     $labels['is_folder'] = 'Папка?';
     $labels['parent_id'] = 'Родительский документ';
     $labels['parent_name'] = 'Родительский документ';
     $labels['root_id'] = 'Корневой документ';
     $labels['root_name'] = 'Корневой документ';
     if ($this->template_id) {
         $template = Template::findOne($this->template_id);
     }
     for ($i = 1; $i <= Template::OPTIONS_COUNT; $i++) {
         $option_name = 'option_' . $i . '_name';
         $labels['option_' . $i] = isset($template->{$option_name}) && $template->{$option_name} ? $template->{$option_name} : 'Опция ' . $i;
         $labels['option_' . $i . '_file'] = isset($template->{$option_name}) && $template->{$option_name} ? $template->{$option_name} : 'Опция ' . $i;
     }
     return $labels;
 }
開發者ID:p0vidl0,項目名稱:yii2-lowbase,代碼行數:41,代碼來源:Document.php

示例4: getSearchableModelAttributes

 /**
  * @param ActiveRecord $model
  * @param array $except
  * @return \im\search\components\searchable\AttributeDescriptor[]
  */
 protected function getSearchableModelAttributes($model, $except = [])
 {
     $searchableAttributes = [];
     $attributes = $model->attributes();
     $labels = $model->attributeLabels();
     foreach ($attributes as $attribute) {
         if (!in_array($attribute, $except)) {
             $searchableAttributes[] = new AttributeDescriptor(['name' => $attribute, 'label' => isset($labels[$attribute]) ? $labels[$attribute] : $model->generateAttributeLabel($attribute)]);
         }
     }
     return $searchableAttributes;
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:17,代碼來源:SearchableType.php

示例5: attributeLabels

 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     $labels = parent::attributeLabels();
     $labels['id'] = 'ID';
     $labels['name'] = 'Название';
     $labels['path'] = 'Путь к файлу';
     for ($i = 1; $i <= self::OPTIONS_COUNT; $i++) {
         $labels['option_' . $i . '_name'] = 'Название поля ' . $i;
         $labels['option_' . $i . '_type'] = 'Тип поля ' . $i;
         $labels['option_' . $i . '_require'] = 'Обязательность поля ' . $i;
         $labels['option_' . $i . '_param'] = 'Параметр поля ' . $i;
     }
     return $labels;
 }
開發者ID:darkffh,項目名稱:yii2-lowbase,代碼行數:17,代碼來源:Template.php

示例6: attributeLabels

 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return array_merge(parent::attributeLabels(), ['id' => \Yii::t('skeeks/money', 'ID'), 'code' => \Yii::t('skeeks/money', "Currency"), 'active' => \Yii::t('skeeks/money', 'Active'), 'course' => \Yii::t('skeeks/money', "Rate"), 'name' => \Yii::t('skeeks/money', "Name"), 'name_full' => \Yii::t('skeeks/money', "Full name"), 'priority' => \Yii::t('skeeks/money', 'Priority')]);
 }
開發者ID:skeeks-cms,項目名稱:cms-module-money,代碼行數:7,代碼來源:MoneyCurrency.php


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