TestBlock.php in Page Manager 8
File
tests/modules/page_manager_test/src/Plugin/Block/TestBlock.php
View source
<?php
namespace Drupal\page_manager_test\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
class TestBlock extends BlockBase {
public function build() {
$build['#markup'] = $this
->t('Example output');
return $build;
}
public function blockForm($form, FormStateInterface $form_state) {
$form['example'] = [
'#type' => 'textfield',
'#title' => $this
->t('Example'),
'#ajax' => [
'callback' => [
$this,
'exampleAjaxCallback',
],
],
];
return $form;
}
public function exampleAjaxCallback($form, FormStateInterface $form_state) {
}
}
Classes
Name |
Description |
TestBlock |
Provides a block to test page_manager. |