function EntityView::blockForm

Same name and namespace in other branches
  1. 4.0.x src/Plugin/Block/EntityView.php \Drupal\ctools\Plugin\Block\EntityView::blockForm()

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/EntityView.php, line 90

Class

EntityView
Provides a block to view a specific entity.

Namespace

Drupal\ctools\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
    $form['view_mode'] = [
        '#type' => 'select',
        '#options' => $this->entityDisplayRepository
            ->getViewModeOptions($this->getDerivativeId()),
        '#title' => $this->t('View mode'),
        '#default_value' => $this->configuration['view_mode'],
    ];
    return $form;
}