You are here

public function ViewStorage::getPaths in Views (for Drupal 7) 8.3

Gets a list of paths assigned to the view.

Return value

array An array of paths for this view.

File

lib/Drupal/views/ViewStorage.php, line 358
Definition of Drupal\views\ViewStorage.

Class

ViewStorage
Defines a ViewStorage configuration entity class.

Namespace

Drupal\views

Code

public function getPaths() {
  $all_paths = array();
  if (empty($this->display)) {
    $all_paths[] = t('Edit this view to add a display.');
  }
  else {
    foreach ($this->display as $display) {
      if (!empty($display['display_options']['path'])) {
        $path = $display['display_options']['path'];
        if ($this
          ->isEnabled() && strpos($path, '%') === FALSE) {
          $all_paths[] = l('/' . $path, $path);
        }
        else {
          $all_paths[] = check_plain('/' . $path);
        }
      }
    }
  }
  return array_unique($all_paths);
}