function ViewExecutable::setArguments

Same name in other branches
  1. 9 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::setArguments()
  2. 8.9.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::setArguments()
  3. 11.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::setArguments()

Sets the arguments for the view.

Parameters

array $args: The arguments passed to the view.

2 calls to ViewExecutable::setArguments()
ViewExecutable::preExecute in core/modules/views/src/ViewExecutable.php
Runs attachments and lets the display do what it needs to before running.
ViewExecutable::__wakeup in core/modules/views/src/ViewExecutable.php
Magic method implementation to unserialize the view executable.

File

core/modules/views/src/ViewExecutable.php, line 549

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function setArguments(array $args) {
    // The array keys of the arguments will be incorrect if set by
    // views_embed_view() or \Drupal\views\ViewExecutable:preview().
    $this->args = array_values($args);
}

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