class ManagedFile

Processes the "managed_file" element.

Plugin annotation

@BootstrapProcess("managed_file")

Hierarchy

Expanded class hierarchy of ManagedFile

Related topics

Namespace

Drupal\bootstrap\Plugin\Process
Source
class ManagedFile extends ProcessBase implements ProcessInterface {

  /**
   * {@inheritdoc}
   */
  public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {
    $ajax_wrapper_id = $element->upload_button->getProperty('ajax')['wrapper'];
    if ($prefix = $element->getProperty('prefix')) {
      $prefix = preg_replace('/<div id="' . $ajax_wrapper_id . '">/', '<div id="' . $ajax_wrapper_id . '" class="form-group">', $prefix);
      $element->setProperty('prefix', $prefix);
    }
  }

}

Members

Contains filters are case sensitive
Name Modifiers Type Description
ManagedFile::processElement public static function Process a specific form element. Overrides ProcessBase::processElement
PluginBase::$theme protected property The currently set theme object.
PluginBase::__construct public function
ProcessBase::process public static function Process a specific form element type. Overrides ProcessInterface::process