Drupal 8: Delete view programmatically

If you should run into the same situation, that you'd like to delete a view programmatically, for example on module uninstall, here you go:

  1. \Drupal::service('config.factory')->getEditable('views.view.' . $view_name)->delete();

Kommentare

Thanks a lot, it helped me.

Thanks a lot, it helped me.

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.

Weitere Informationen über Formatierungsoptionen