CI_URI::_slash_segment PHP Method

_slash_segment() protected method

Fetches an URI Segment and adds a slash to it.
protected _slash_segment ( integer $n, string $where = 'trailing', string $which = 'segment' ) : string
$n integer Index
$where string Where to add the slash ('trailing' or 'leading')
$which string Array name ('segment' or 'rsegment')
return string
    protected function _slash_segment($n, $where = 'trailing', $which = 'segment')
    {
        $leading = $trailing = '/';
        if ($where === 'trailing') {
            $leading = '';
        } elseif ($where === 'leading') {
            $trailing = '';
        }
        return $leading . $this->{$which}($n) . $trailing;
    }