Get value() by block_id when it isnt a form submission
This commit is contained in:
parent
145e322317
commit
e9980ff9fd
@ -61,8 +61,15 @@ class ViewSubmission extends Base
|
|||||||
return new Modal;
|
return new Modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function value(string $block_id,string $action_id): ?string
|
public function value(string $block_id,string $action_id=NULL): ?string
|
||||||
{
|
{
|
||||||
return object_get($this->state->get($block_id),$action_id.'.value');
|
// If there is no state we need to search out blocks for the block_id
|
||||||
|
if (! $this->state->count()) {
|
||||||
|
$block = $this->blocks->search(function($item) use ($block_id) { return $item->block_id == $block_id; });
|
||||||
|
return $block !== FALSE ? object_get($this->blocks->get($block),$action_id) : NULL;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return object_get($this->state->get($block_id),$action_id.'.value');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user