public function link($skip_last = true, $different_links = false)
{
if (!is_bool($skip_last) || !is_bool($different_links)) {
throw new \InvalidArgumentException('Link method expects a boolean variable!');
}
$this->initCurrentUrl();
$this->skipLast = $skip_last;
$position = 1;
foreach ($this->segments as $key => $segment) {
$this->setNextCurrentURL($segment, $different_links);
$this->setLink($key, $segment, $position);
$position++;
}
return $this->segments;
}