Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. * @ContentEntityType(
  2. ...
  3. * handlers = {
  4. * "form" = {
  5. * "add" = "Drupalmy_moduleFormMyEntityForm",
  6. * "edit" = "Drupalmy_moduleFormMyEntityForm",
  7. * "delete" = "Drupalmy_moduleFormMyEntityDeleteForm",
  8. ...
  9.  
  10. $form['add_my_entity_button'] = [
  11. '#type' => 'link',
  12. '#title' => t('Add NewEntity'),
  13. '#url' => Url::fromRoute(
  14. 'my_module.add_entity',
  15. array(
  16. 'node' => is_numeric($node) ? $node : NULL,
  17. )
  18. ),
  19. '#attributes' => [
  20. 'class' => ['button', 'use-ajax'],
  21. 'data-dialog-type' => 'modal',
  22. ],
  23. '#attached' => [
  24. 'library' => ['core/drupal.dialog.ajax'],
  25. ],
  26. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement