TestInlineTemplateFormBlock.php in Drupal 8
File
core/modules/layout_builder/tests/modules/layout_builder_form_block_test/src/Plugin/Block/TestInlineTemplateFormBlock.php
View source
<?php
namespace Drupal\layout_builder_form_block_test\Plugin\Block;
use Drupal\Core\Block\BlockBase;
class TestInlineTemplateFormBlock extends BlockBase {
public function build() {
$build['form'] = [
'#type' => 'inline_template',
'#template' => '<form method="POST"><label>{{ "Keywords"|t }}<input name="keyword" type="text" required /></label><input name="submit" type="submit" value="{{ "Submit"|t }}" /></form>',
];
return $build;
}
}