protected ViewListBuilder::getDisplayPaths(EntityInterface $view)
Gets a list of paths assigned to the view.
Parameters
\Drupal\Core\Entity\EntityInterface $view: The view entity.
Return value
array An array of paths for this view.
File
- core/modules/views_ui/src/ViewListBuilder.php, line 267
Class
- ViewListBuilder
- Defines a class to build a listing of view entities.
Namespace
Drupal\views_ui
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | protected function getDisplayPaths(EntityInterface $view ) { $all_paths = array (); $executable = $view ->getExecutable(); $executable ->initDisplay(); foreach ( $executable ->displayHandlers as $display ) { if ( $display ->hasPath()) { $path = $display ->getPath(); if ( $view ->status() && strpos ( $path , '%' ) === FALSE) { // @todo Views should expect and store a leading /. See: $all_paths [] = \Drupal::l( '/' . $path , Url::fromUserInput( '/' . $path )); } else { $all_paths [] = '/' . $path ; } } } return array_unique ( $all_paths ); } |
Please login to continue.