You are here

public function SubformStateInterface::conditionalElement in Markdown 8.2

Creates conditional markup.

This is primarily intended to add supplemental "markup" or "message" through out the UI to help inform users why certain things are disabled or otherwise unavailable.

Parameters

array $element: A render array element. By default, the element is an inline span and all that is needed is the #value (i.e. translatable string). However, the element can be completely custom.

string $state: The state that will be applied to $element when conditions are met.

string $name: The input element name.

array $conditions: The conditions for the $state.

Return value

\Drupal\Component\Render\MarkupInterface The rendered $element.

1 method overrides SubformStateInterface::conditionalElement()
SubformState::conditionalElement in src/Form/SubformState.php
{@inheritdoc

File

src/Form/SubformStateInterface.php, line 50

Class

SubformStateInterface
Interface for markdown plugin subforms.

Namespace

Drupal\markdown\Form

Code

public function conditionalElement(array $element, $state, $name, array $conditions);