当前位置: 首页>>代码示例>>PHP>>正文


PHP CActiveRecord::getAttributeLabel方法代码示例

本文整理汇总了PHP中CActiveRecord::getAttributeLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::getAttributeLabel方法的具体用法?PHP CActiveRecord::getAttributeLabel怎么用?PHP CActiveRecord::getAttributeLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CActiveRecord的用法示例。


在下文中一共展示了CActiveRecord::getAttributeLabel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getViewAttributesEntry

 /**
  * Renvoie une ligne à insérer dans le tableau 'attributes' d'un widget de type CDetailView, CGridView...
  * Le formatage varie selon le type de la colonne $column
  * @param CDbColumnSchema $column
  * @param CActiveRecord   $templateRecord
  * @return string
  */
 public static function getViewAttributesEntry(CDbColumnSchema $column, CActiveRecord $templateRecord)
 {
     switch ($column->dbType) {
         case 'date':
             $out = "{$column->name}:date:" . $templateRecord->getAttributeLabel($column->name);
             break;
         case 'datetime':
             $out = "{$column->name}:datetime:" . $templateRecord->getAttributeLabel($column->name);
             break;
         default:
             $out = $column->name;
     }
     return $out;
 }
开发者ID:ChristopheBrun,项目名称:hLib,代码行数:21,代码来源:CodeGeneratorHelper.php

示例2: run

    public function run()
    {
        $idFrom = EHtml::resolveId($this->model, $this->attributeName);
        $idTo = EHtml::resolveId($this->model, $this->attributeDateTo);
        Yii::app()->clientScript->registerScript('datePickerInitialize', '
			$.datepicker.setDefaults( $.datepicker.regional["ru"] );
			$("#' . $idFrom . '").datepicker({
				onSelect: function( selectedDate ) {
					$( "#' . $idTo . '" ).datepicker( "option", "minDate", selectedDate );
				}
			});
			$("#' . $idTo . '").datepicker({
				onSelect: function( selectedDate ) {
					$( "#' . $idFrom . '" ).datepicker( "option", "maxDate", selectedDate );
				}
			});
		');
        echo "\n<style type='text/css'>\n.controls-line {\n\tmargin-bottom: 5px;\n}\n</style>\n<div class='control-group'>\n\t" . CHtml::activeLabelEx($this->model, $this->attributeName, array('class' => 'control-label')) . "\n\t<div class='controls controls-line'>\n\t\t<div class='input-append'>\n\t\t\t{$this->form->textField($this->model, $this->attributeName)}<span class='add-on'><i class='icon-calendar'></i></span>\n\t\t</div>\n\t\t<div class='input-append'>\n\t\t\t<label style='margin: 0 20px; display:inline;' for='" . $idTo . "'>\n\t\t\t\t{$this->model->getAttributeLabel($this->attributeDateTo)}\n\t\t\t</label>\n\t\t\t{$this->form->textField($this->model, $this->attributeDateTo)}<span class='add-on'><i class='icon-calendar'></i></span>\n\t\t</div>\n\t</div>\n\t<div class='controls'>\n\t\t{$this->form->error($this->model, $this->attributeName)}\n\t\t{$this->form->error($this->model, $this->attributeDateTo)}\n\t</div>\n</div>\n";
    }
开发者ID:DarkAiR,项目名称:test,代码行数:19,代码来源:DateRangeRowWidget.php

示例3: renderForm

 public function renderForm()
 {
     echo '<br />';
     echo '<br />';
     echo CHtml::tag('h3', array(), $this->exoModel->getAttributeLabel($this->exoAttr));
     echo '<hr />';
     $this->renderInputs();
     echo '<br />';
     echo '<br />';
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:10,代码来源:JSONEmbeddedModel.php

示例4: getAttributeLabel

 /**
  * This function internationalize the labels using Yii::t()
  * @see CActiveRecord::getAttributeLabel()
  */
 public function getAttributeLabel($attribute)
 {
     $baseLabel = parent::getAttributeLabel($attribute);
     return Yii::t('waterrequest', $baseLabel);
 }
开发者ID:Gnafu,项目名称:wiz,代码行数:9,代码来源:Wms.php

示例5: getElements

 /**
  * @param CActiveRecord $model
  * @param array $attributes
  * @return array
  */
 public static function getElements($model, $attributes = [])
 {
     $modelAttributes = $model->getAttributes();
     $modelElements = [];
     foreach ($modelAttributes as $attrName => $attrVal) {
         if (!empty($attributes)) {
             foreach ($attributes as $attr) {
                 if ($attrName === $attr) {
                     $modelElements[$attr] = ['label' => $model->getAttributeLabel($attr), 'required' => $model->isAttributeRequired($attr), 'type' => 'text'];
                 }
             }
             continue;
         }
         $modelElements[$attrName] = ['label' => $model->getAttributeLabel($attrName), 'required' => $model->isAttributeRequired($attrName), 'type' => 'text'];
         //			if ($field->inputType == 'dropdownlist') {
         //				$elements['elements']['contextFields']['elements'][$field->inputName . '-' . $field->id]['items'] =
         //					Options::model()->getContextFieldOptions($field->id);
         //			}
     }
     return $modelElements;
 }
开发者ID:schrapps,项目名称:risksur,代码行数:26,代码来源:ContextController.php

示例6: getAttributeLabel

 public function getAttributeLabel($attribute)
 {
     if (!$this->eavEnable) {
         return parent::getAttributeLabel($attribute);
     }
     if ($this->hasEavAttribute($attribute)) {
         if (!is_null($this->eavAttributeInstances[$attribute]->label) && $this->eavAttributeInstances[$attribute]->label !== '') {
             return $this->eavAttributeInstances[$attribute]->label;
         }
     }
     return parent::getAttributeLabel($attribute);
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-spa,代码行数:12,代码来源:EavActiveRecord.php

示例7: attributeLabels

 public function attributeLabels()
 {
     return array('email' => $this->_model->getAttributeLabel($this->emailAtt), 'username' => $this->_model->getAttributeLabel($this->nameAtt), 'password' => HOAuthAction::t('Password'));
 }
开发者ID:Canyian,项目名称:hoauth,代码行数:4,代码来源:HUserInfoForm.php


注:本文中的CActiveRecord::getAttributeLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。