当前位置: 首页>>代码示例>>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;未经允许,请勿转载。