You are here

function masked_input_view_configured_definitions in Masked Input 8

Same name and namespace in other branches
  1. 7.2 masked_input.module \masked_input_view_configured_definitions()

Returns a build to render a preview of available mask definitions as a table.

1 call to masked_input_view_configured_definitions()
MaskedinputFieldWidgetDefault::settingsForm in src/Plugin/Field/FieldWidget/MaskedinputFieldWidgetDefault.php
Returns a form to configure settings for the widget.

File

./masked_input.module, line 42
Contains masked_input.module.

Code

function masked_input_view_configured_definitions() {

  // Get default masks.
  $rows = array();

  // Get configured masks.
  $masked_input_definitions = \Drupal::config('masked_input.settings')
    ->get('masked_input_definitions');
  foreach ($masked_input_definitions as $definition) {
    $rows[] = array(
      array(
        'data' => $definition['character'],
      ),
      array(
        'data' => $definition['regex'],
      ),
      array(
        'data' => $definition['description'],
      ),
    );
  }
  return $rows;
}