示例#1
0
 /**
  * {@inheritdoc}
  *
  * @param \Drupal\Core\Menu\MenuLinkInterface $menu_link_plugin
  *   The plugin instance to use for this form.
  */
 public function buildForm(array $form, array &$form_state, MenuLinkInterface $menu_link_plugin = NULL)
 {
     $form['menu_link_id'] = array('#type' => 'value', '#value' => $menu_link_plugin->getPluginId());
     $class_name = $menu_link_plugin->getFormClass();
     $form['#plugin_form'] = $this->classResolver->getInstanceFromDefinition($class_name);
     $form['#plugin_form']->setMenuLinkInstance($menu_link_plugin);
     $form += $form['#plugin_form']->buildConfigurationForm($form, $form_state);
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Save'), '#button_type' => 'primary');
     return $form;
 }