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