Drupal 8  8.0.2
MenuLinkDefaultForm Class Reference
Inheritance diagram for MenuLinkDefaultForm:

Public Member Functions

 __construct (MenuLinkManagerInterface $menu_link_manager, MenuParentFormSelectorInterface $menu_parent_selector, TranslationInterface $string_translation, ModuleHandlerInterface $module_handler)
 
 setMenuLinkInstance (MenuLinkInterface $menu_link)
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 extractFormValues (array &$form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $menuLink
 
 $menuLinkManager
 
 $menuParentSelector
 
 $moduleHandler
 
 $moduleData
 

Detailed Description

Provides an edit form for static menu links.

See Also

Constructor & Destructor Documentation

__construct ( MenuLinkManagerInterface  $menu_link_manager,
MenuParentFormSelectorInterface  $menu_parent_selector,
TranslationInterface  $string_translation,
ModuleHandlerInterface  $module_handler 
)

Constructs a new .

Parameters
\Drupal\Core\Menu\MenuLinkManagerInterface$menu_link_managerThe menu link manager.
\Drupal\Core\Menu\MenuParentFormSelectorInterface$menu_parent_selectorThe menu parent form selector service.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler;

References Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

{Form constructor.Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.
}

Implements PluginFormInterface.

References Drupal\moduleHandler(), and t().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{Instantiates a new instance of this class.This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this instance should use.
}

Implements ContainerInjectionInterface.

extractFormValues ( array &  $form,
FormStateInterface  $form_state 
)

{Extracts a plugin definition from form values.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
array The new plugin definition values taken from the form values.
}

Implements MenuLinkFormInterface.

References FormStateInterface\getValue().

Referenced by MenuLinkDefaultForm\submitConfigurationForm().

Here is the call graph for this function:

Here is the caller graph for this function:

setMenuLinkInstance ( MenuLinkInterface  $menu_link)

{Injects the menu link plugin instance.

Parameters
\Drupal\Core\Menu\MenuLinkInterface$menu_linkA menu link plugin instance.
}

Implements MenuLinkFormInterface.

submitConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.

References MenuLinkDefaultForm\extractFormValues().

Here is the call graph for this function:

validateConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form validation handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.


The documentation for this class was generated from the following file: