'no message set', ]; } /** * {@inheritdoc} */ protected function blockAccess(AccountInterface $account) { return AccessResult::allowedIfHasPermission($account, 'access content'); } /** * {@inheritdoc} */ public function blockForm($form, FormStateInterface $form_state) { $form['display_message'] = [ '#type' => 'textfield', '#title' => $this->t('Display message'), '#default_value' => $this->configuration['display_message'], ]; return $form; } /** * {@inheritdoc} */ public function blockSubmit($form, FormStateInterface $form_state) { $this->configuration['display_message'] = $form_state->getValue('display_message'); } /** * {@inheritdoc} */ public function build() { return [ '#children' => $this->configuration['display_message'], ]; } }