本文整理汇总了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);
}
}
}
}
示例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);
}
示例3: getValue
public function getValue()
{
parent::getValue();
foreach ($this->options as $value => $description) {
if ($this->value == $value) {
$this->description = $description;
}
}
}
示例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);
}
}
示例5: getValue
function getValue()
{
parent::getValue();
if (count($this->local_options)) {
foreach ($this->options as $value => $description) {
if ($this->value == $value) {
$this->description = $description;
}
}
}
}
示例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);
}
示例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;
}
}
}
}
示例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;
}
}
}
}
示例9: getValue
function getValue()
{
parent::getValue();
$this->checked = (bool) ($this->value == $this->checked_value);
}