ConditionManager example

/** * {@inheritdoc} */
  public function getFormId() {
    return 'condition_node_type_test_form';
  }

  /** * Constructs a \Drupal\condition_test\FormController object. */
  public function __construct() {
    $manager = new ConditionManager(\Drupal::service('container.namespaces'), \Drupal::cache('discovery'), \Drupal::moduleHandler());
    $this->condition = $manager->createInstance('entity_bundle:node');
    $this->conditionCurrentTheme = $manager->createInstance('current_theme');
  }

  /** * {@inheritdoc} */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['#tree'] = TRUE;
    $form['entity_bundle'] = [];
    $subformState = SubformState::createForSubform($form['entity_bundle']$form$form_state);
    
Home | Imprint | This part of the site doesn't use cookies.