You are here

public function Candidates::getCandidates in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/Candidates/Candidates.php \Symfony\Cmf\Component\Routing\Candidates\Candidates::getCandidates()

Parameters

Request $request:

Return value

array a list of paths

Overrides CandidatesInterface::getCandidates

File

vendor/symfony-cmf/routing/Candidates/Candidates.php, line 84

Class

Candidates
A straightforward strategy that splits the URL on "/".

Namespace

Symfony\Cmf\Component\Routing\Candidates

Code

public function getCandidates(Request $request) {
  $url = $request
    ->getPathInfo();
  $candidates = $this
    ->getCandidatesFor($url);
  $locale = $this
    ->determineLocale($url);
  if ($locale) {
    $candidates = array_unique(array_merge($candidates, $this
      ->getCandidatesFor(substr($url, strlen($locale) + 1))));
  }
  return $candidates;
}