Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a List of Available Drupal Views

I'd like to set up a configuration page for my Drupal module that contains a dropdown where the user selects one of the available views. Is there an easy way to obtain a list of all available views on the system? All I need is an array of all the views' names.

like image 244
derekerdmann Avatar asked Dec 03 '25 00:12

derekerdmann


1 Answers

Try the views_all_get_views function ... this returns an array of views, indexed by name, so you could wrap array_keys() around the result to get the names.

like image 175
Dan U. Avatar answered Dec 05 '25 13:12

Dan U.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!