Refactor form blocks to use composition instead of inheritance
[MAILPOET-2665]
This commit is contained in:
committed by
Jack Kitterhing
parent
20926d56b7
commit
c6ca749cdc
@@ -2,14 +2,21 @@
|
||||
|
||||
namespace MailPoet\Form\Block;
|
||||
|
||||
class Submit extends Base {
|
||||
class Submit {
|
||||
|
||||
/** @var Base */
|
||||
private $baseRenderer;
|
||||
|
||||
public function __construct(Base $baseRenderer) {
|
||||
$this->baseRenderer = $baseRenderer;
|
||||
}
|
||||
|
||||
public function render($block) {
|
||||
$html = '';
|
||||
|
||||
$html .= '<p class="mailpoet_paragraph"><input type="submit" class="mailpoet_submit" ';
|
||||
|
||||
$html .= 'value="' . $this->getFieldLabel($block) . '" ';
|
||||
$html .= 'value="' . $this->baseRenderer->getFieldLabel($block) . '" ';
|
||||
|
||||
$html .= 'data-automation-id="subscribe-submit-button" ';
|
||||
|
||||
|
Reference in New Issue
Block a user