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


PHP Field::getValue方法代碼示例

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


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

示例1: getValue

 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, trim(strstr($this->rel_key, '.'), '.'));
     }
     parent::getValue();
     if (count($this->local_options)) {
         $description_arr = array();
         $this->fill_tags = "";
         foreach ($this->options as $value => $description) {
             if (in_array($value, $this->values)) {
                 $description_arr[] = $description;
                 $row = new \stdClass();
                 $row->key = $value;
                 $row->value = $description;
                 $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
             }
         }
         $this->description = implode($this->separator, $description_arr);
     } elseif ($this->relation != null) {
         if ($this->is_refill) {
             $values = explode($this->serialization_sep, $this->value);
             $entity = get_class($this->relation->getRelated());
             $related = $entity::whereIn($this->record_id, $values)->get();
         } else {
             $related = $this->relation->get();
         }
         $name = $this->rel_field;
         $key = $this->record_id;
         $this->fill_tags = "";
         if (count($related)) {
             foreach ($related as $item) {
                 $row = new \stdClass();
                 $row->{$key} = $item->{$key};
                 $row->{$name} = $item->{$name};
                 $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
                 $description_arr[] = $item->{$name};
             }
             $this->description = implode($this->separator, $description_arr);
         }
     } else {
         if ($this->value) {
             $values = explode($this->serialization_sep, $this->value);
             $name = $this->record_label;
             $key = $this->record_id;
             $this->fill_tags = "";
             if (count($values)) {
                 //var_dump($values);
                 foreach ($values as $item) {
                     $row = new \stdClass();
                     $row->{$key} = $item;
                     $row->{$name} = $item;
                     $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
                     $description_arr[] = $item;
                 }
                 $this->description = implode($this->separator, $description_arr);
             }
         }
     }
 }
開發者ID:procesorrr,項目名稱:ServProgramator,代碼行數:60,代碼來源:Tags.php

示例2: getValue

 public function getValue()
 {
     parent::getValue();
     if (\Request::isMethod('post') && !\Input::exists($this->name)) {
         $this->value = $this->unchecked_value;
     }
     $this->checked = (bool) ($this->value == $this->checked_value);
 }
開發者ID:maxmirazh33,項目名稱:rapyd-laravel,代碼行數:8,代碼來源:Checkbox.php

示例3: getValue

 public function getValue()
 {
     parent::getValue();
     foreach ($this->options as $value => $description) {
         if ($this->value == $value) {
             $this->description = $description;
         }
     }
 }
開發者ID:chellmann,項目名稱:rapyd-laravel,代碼行數:9,代碼來源:Radiogroup.php

示例4: getValue

 public function getValue()
 {
     Field::getValue();
     $this->values = explode($this->serialization_sep, $this->value);
     foreach ($this->values as $value) {
         $values[] = $this->isoDateToHuman($value);
     }
     if (isset($values)) {
         $this->value = implode($this->serialization_sep, $values);
     }
 }
開發者ID:drickferreira,項目名稱:rastreador,代碼行數:11,代碼來源:Daterange.php

示例5: getValue

 function getValue()
 {
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
開發者ID:parabol,項目名稱:laravel-cms,代碼行數:11,代碼來源:Autocomplete.php

示例6: getValue

 public function getValue()
 {
     parent::getValue();
     $this->values = explode($this->serialization_sep, $this->value);
     $description_arr = array();
     foreach ($this->options as $value => $description) {
         if (in_array($value, $this->values)) {
             $description_arr[] = $description;
         }
     }
     $this->description = implode($this->separator, $description_arr);
 }
開發者ID:parabol,項目名稱:laravel-cms,代碼行數:12,代碼來源:Checkboxgroup.php

示例7: getValue

 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, preg_replace('#([a-z0-9_-]+\\.)?(.*)#i', '$2', $this->rel_key));
     }
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
開發者ID:Dnishche,項目名稱:fispm,代碼行數:14,代碼來源:Autocomplete.php

示例8: getValue

 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, trim(strstr($this->rel_key, '.'), '.'));
     }
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
開發者ID:serverfireteam,項目名稱:rapyd-laravel,代碼行數:14,代碼來源:Autocomplete.php

示例9: getValue

 function getValue()
 {
     parent::getValue();
     $this->checked = (bool) ($this->value == $this->checked_value);
 }
開發者ID:parabol,項目名稱:laravel-cms,代碼行數:5,代碼來源:Checkbox.php


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