From 1ba5e59fbf1d0feb8b624b384a93e45189e0a4b4 Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Thu, 2 Jan 2020 16:35:08 +0000 Subject: [PATCH] Support submit button value retrieve in protected --- src/Form/FormSubmitDecorator.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Form/FormSubmitDecorator.php b/src/Form/FormSubmitDecorator.php index b47711d..1707396 100644 --- a/src/Form/FormSubmitDecorator.php +++ b/src/Form/FormSubmitDecorator.php @@ -22,11 +22,19 @@ public function setValue(string $value) return $this; } + protected function _getValue() + { + return $this->_value; + } + protected function _getContentForRender() { - return Div::create( - Input::create()->setType(Input::TYPE_SUBMIT)->setValue($this->_value) - )->addClass('p-form--submit'); + return Div::create($this->_input())->addClass('p-form--submit'); + } + + protected function _input() + { + return Input::create()->setType(Input::TYPE_SUBMIT)->setValue($this->_getValue()); } protected function _prepareForProduce(): HtmlElement