當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。