public function View::getPaths

Gets a list of paths assigned to the view.

Return value

array An array of paths for this view.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php, line 352
Definition of Drupal\views\Plugin\Core\Entity\View.

Class

View
Defines a View configuration entity class.

Namespace

Drupal\views\Plugin\Core\Entity

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);
}