fieldry-1.0.x-dev/src/Plugin/ConfigurableWrapperInterface.php
src/Plugin/ConfigurableWrapperInterface.php
<?php
namespace Drupal\fieldry\Plugin;
use Drupal\Core\Form\FormStateInterface;
/**
* Interface for field wrappers with configuration form options.
*
* Interface is similar to the \Drupal\Core\Plugin\PluginFormInterface but
* without the validate and submit methods. The field wrapper does not support
* these because they appear on the field formatter settings and those forms
* do not call validate or submit like normal forms.
*
* Instead, it's important to use form "#element_validate" and "#value_callback"
* as appropriate for validation and value massaging.
*/
interface ConfigurableWrapperInterface extends WrapperInterface {
/**
* Generate the configuration form for this field wrapper.
*
* @param array $form
* Form elements implementing the field wrapper configurations.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form state, which is expected to be the \Drupal\Core\Form\SubFormState.
*
* @return array
* Form elements for the field wrapper configurations.
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array;
}
