You are here

public static function YamlFormManagedFileBase::getVisibleStreamWrappers in YAML Form 8

Get visible stream wrappers.

Return value

array An associative array of visible stream wrappers keyed by type.

5 calls to YamlFormManagedFileBase::getVisibleStreamWrappers()
YamlFormManagedFileBase::displayDisabledWarning in src/Plugin/YamlFormElement/YamlFormManagedFileBase.php
Display element disabled warning.
YamlFormManagedFileBase::form in src/Plugin/YamlFormElement/YamlFormManagedFileBase.php
Gets the actual configuration form array to be built.
YamlFormManagedFileBase::getUriScheme in src/Plugin/YamlFormElement/YamlFormManagedFileBase.php
Get file upload URI scheme.
YamlFormManagedFileBase::isEnabled in src/Plugin/YamlFormElement/YamlFormManagedFileBase.php
Checks if element is enabled.
YamlFormManagedFileBase::prepare in src/Plugin/YamlFormElement/YamlFormManagedFileBase.php
Prepare an element to be rendered within a form.

File

src/Plugin/YamlFormElement/YamlFormManagedFileBase.php, line 666

Class

YamlFormManagedFileBase
Provides a base class form 'managed_file' elements.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public static function getVisibleStreamWrappers() {
  $stream_wrappers = \Drupal::service('stream_wrapper_manager')
    ->getNames(StreamWrapperInterface::WRITE_VISIBLE);
  if (!\Drupal::config('yamlform.settings')
    ->get('file.file_public')) {
    unset($stream_wrappers['public']);
  }
  return $stream_wrappers;
}