class MenuLinkFieldForm in Menu Link (Field) 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/Menu/Form/MenuLinkFieldForm.php \Drupal\menu_link\Plugin\Menu\Form\MenuLinkFieldForm
Provides the menu link edit form for the field-based menu link.
Hierarchy
- class \Drupal\Core\Menu\Form\MenuLinkDefaultForm implements ContainerInjectionInterface, MenuLinkFormInterface uses StringTranslationTrait
- class \Drupal\menu_link\Plugin\Menu\Form\MenuLinkFieldForm
Expanded class hierarchy of MenuLinkFieldForm
1 file declares its use of MenuLinkFieldForm
- MenuLinkItem.php in src/
Plugin/ Field/ FieldType/ MenuLinkItem.php
File
- src/
Plugin/ Menu/ Form/ MenuLinkFieldForm.php, line 11
Namespace
Drupal\menu_link\Plugin\Menu\FormView source
class MenuLinkFieldForm extends MenuLinkDefaultForm {
/**
* The Menu link.
*
* @var \Drupal\menu_link\Plugin\Menu\MenuLinkField
*/
protected $menuLink;
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$entity = $this->menuLink
->getEntity();
$form['info'] = [
'#type' => 'item',
'#title' => $this
->t('This link is provided by the %type: <a href="@url">@label</a>. The path cannot be edited.', [
'%type' => $entity
->getEntityType()
->getLabel(),
'@url' => $entity
->toUrl(),
'@label' => $entity
->label(),
]),
];
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuLinkDefaultForm:: |
protected | property | The menu link manager. | |
MenuLinkDefaultForm:: |
protected | property | The parent form selector service. | |
MenuLinkDefaultForm:: |
protected | property | The module handler service. | |
MenuLinkDefaultForm:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
MenuLinkDefaultForm:: |
public | function |
Extracts a plugin definition from form values. Overrides MenuLinkFormInterface:: |
1 |
MenuLinkDefaultForm:: |
public | function |
Injects the menu link plugin instance. Overrides MenuLinkFormInterface:: |
|
MenuLinkDefaultForm:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
|
MenuLinkDefaultForm:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
MenuLinkDefaultForm:: |
public | function | Constructs a new \Drupal\Core\Menu\Form\MenuLinkDefaultForm. | |
MenuLinkFieldForm:: |
protected | property |
The Menu link. Overrides MenuLinkDefaultForm:: |
|
MenuLinkFieldForm:: |
public | function |
Form constructor. Overrides MenuLinkDefaultForm:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |