27 lines
817 B
PHP
27 lines
817 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Reservair\Templating\Elements;
|
||
|
|
|
||
|
|
use Reservair\Templating\RsvTemplateElement;
|
||
|
|
use Reservair\Templating\RsvTemplateSymbols;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Renders a button that asks the form to clear itself. It only carries the
|
||
|
|
* data-rsv-reset marker; RsvFormSender finds marked buttons in the success card
|
||
|
|
* and links them to the form's cleanup. The label can be overridden with the
|
||
|
|
* label attribute.
|
||
|
|
*/
|
||
|
|
class RsvResetFormButtonElement implements RsvTemplateElement {
|
||
|
|
|
||
|
|
public function render(RsvTemplateSymbols $symbols): string {
|
||
|
|
$label = (string) $symbols->get('label', 'Odeslat znova');
|
||
|
|
return '<button type="button" class="rsv-form-btn" data-rsv-reset>'
|
||
|
|
. esc_html($label)
|
||
|
|
. '</button>';
|
||
|
|
}
|
||
|
|
|
||
|
|
public function symbols(): array {
|
||
|
|
return ['label'];
|
||
|
|
}
|
||
|
|
}
|