function views_get_view_result

Same name and namespace in other branches
  1. 10 core/modules/views/views.module \views_get_view_result()
  2. 9 core/modules/views/views.module \views_get_view_result()
  3. 8.9.x core/modules/views/views.module \views_get_view_result()
  4. main core/modules/views/views.module \views_get_view_result()

Get the result of a view.

Parameters

string $name: The name of the view to retrieve the data from.

string $display_id: The display ID. On the edit page for the view in question, you'll find a list of displays at the left side of the control area. "Default" will be at the top of that list. Hover your cursor over the name of the display you want to use. A URL will appear in the status bar of your browser. This is usually at the bottom of the window, in the chrome. Everything after #views-tab- is the display ID, e.g. page_1.

mixed ...$args: Any additional parameters will be passed as arguments.

Return value

array An array containing an object for each view item.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use Views::getViewResult($name, $display_id, ...$args) instead.

See also

https://www.drupal.org/node/3572594

File

core/modules/views/views.module, line 452

Code

function views_get_view_result($name, $display_id = NULL, ...$args) {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use Views::getViewResult($name, $display_id, ...$args) instead. See https://www.drupal.org/node/3572594', E_USER_DEPRECATED);
  return Views::getViewResult($name, $display_id, ...$args);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.