3 namespace Drupal\Core\Menu\Form;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\Core\Menu\MenuLinkInterface;
7 use Drupal\Core\Plugin\PluginFormInterface;
10 * Defines an interface for edit forms of menu links.
12 * All menu link plugins use the same interface for their configuration or
13 * editing form, but the implementations may differ.
15 * @see \Drupal\Core\Menu\MenuLinkInterface::getFormClass()
17 interface MenuLinkFormInterface extends PluginFormInterface {
20 * Injects the menu link plugin instance.
22 * @param \Drupal\Core\Menu\MenuLinkInterface $menu_link
23 * A menu link plugin instance.
25 public function setMenuLinkInstance(MenuLinkInterface $menu_link);
28 * Extracts a plugin definition from form values.
31 * An associative array containing the structure of the form.
32 * @param \Drupal\Core\Form\FormStateInterface $form_state
33 * The current state of the form.
36 * The new plugin definition values taken from the form values. The plugin
37 * ID must be returned as part of the definition.
39 public function extractFormValues(array &$form, FormStateInterface $form_state);