Instantly share code, notes, and snippets.

View TextfieldWithMaxlengthWidget
<?php
namespace Drupal\mymodule\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextfieldWidget;
use Drupal\Core\Form\FormStateInterface;
/**
* Plugin implementation of the 'textfield_with_maxlength' widget.