获取可用 Drupal 视图的列表

发布于 2024-09-06 08:14:35 字数 101 浏览 1 评论 0原文

我想为我的 Drupal 模块设置一个配置页面,其中包含一个下拉列表,用户可以在其中选择可用视图之一。有没有一种简单的方法来获取系统上所有可用视图的列表?我所需要的只是所有视图名称的数组。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梅窗月明清似水 2024-09-13 08:14:35

尝试 views_all_get_views 函数 ...这会返回一个视图数组,按名称索引,因此您可以将 array_keys() 包装在结果周围以获取名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文