Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * @ContentEntityType(
- ...
- * handlers = {
- * "form" = {
- * "add" = "Drupalmy_moduleFormMyEntityForm",
- * "edit" = "Drupalmy_moduleFormMyEntityForm",
- * "delete" = "Drupalmy_moduleFormMyEntityDeleteForm",
- ...
- $form['add_my_entity_button'] = [
- '#type' => 'link',
- '#title' => t('Add NewEntity'),
- '#url' => Url::fromRoute(
- 'my_module.add_entity',
- array(
- 'node' => is_numeric($node) ? $node : NULL,
- )
- ),
- '#attributes' => [
- 'class' => ['button', 'use-ajax'],
- 'data-dialog-type' => 'modal',
- ],
- '#attached' => [
- 'library' => ['core/drupal.dialog.ajax'],
- ],
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement