while ($c-- > 0
) { $segmentConvert =
ucfirst($this->translateURIDashes === true ?
str_replace('-', '_',
$segments[0
]) :
$segments[0
]);
// as soon as we encounter any segment that is not PSR-4 compliant, stop searching
if (!
$this->
isValidSegment($segmentConvert)) { return $segments;
} $test = APPPATH . 'Controllers/' .
$this->directory .
$segmentConvert;
// as long as each segment is *not* a controller file but does match a directory, add it to $this->directory
if (!
is_file($test . '.php'
) &&
is_dir($test)) { $this->
setDirectory($segmentConvert, true, false
);
array_shift($segments);
continue;
} return $segments;
} // This means that all segments were actually directories
return $segments;
}