function Raw::getArgument
Return the default argument.
This needs to be overridden by every default argument handler to properly do what is needed.
Overrides ArgumentDefaultPluginBase::getArgument
File
- 
              core/modules/ views/ src/ Plugin/ views/ argument_default/ Raw.php, line 108 
Class
- Raw
- Default argument plugin to use the raw value from the URL.
Namespace
Drupal\views\Plugin\views\argument_defaultCode
public function getArgument() {
  // Don't trim the leading slash since getAliasByPath() requires it.
  $path = rtrim($this->currentPath
    ->getPath($this->view
    ->getRequest()), '/');
  if ($this->options['use_alias']) {
    $path = $this->aliasManager
      ->getAliasByPath($path);
  }
  $args = explode('/', $path);
  // Drop the empty first element created by the leading slash since the path
  // component index doesn't take it into account.
  array_shift($args);
  if (isset($args[$this->options['index']])) {
    return $args[$this->options['index']];
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
