You are here

public function DateTextWidget::__construct in Date 8

Constructs a DateWidget object.

Parameters

array $plugin_id: The plugin_id for the widget.

Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery: The Discovery class that holds access to the widget implementation definition.

Drupal\field\FieldInstance $instance: The field instance to which the widget is associated.

array $settings: The widget settings.

int $weight: The widget weight.

File

lib/Drupal/date/Plugin/field/widget/DateTextWidget.php, line 55
Definition of Drupal\date\Plugin\field\widget\DateTextWidget.

Class

DateTextWidget
Plugin implementation of the 'date' widget.

Namespace

Drupal\date\Plugin\field\widget

Code

public function __construct($plugin_id, DiscoveryInterface $discovery, FieldInstance $instance, array $settings, $weight) {

  // Identify the function used to set the default value.
  $instance['default_value_function'] = 'date_default_value';
  parent::__construct($plugin_id, $discovery, $instance, $settings, $weight);
}