13/03/2017 11:43am

PHP | Problem - DO Link


  public function Link() {

$shop = Shop::get()->first()->URLSegment;
$home = RootURLController::get_default_homepage_link();

if($shop != $home) {
$shopURL = $shop . '/';
} else {
$shopURL = null;
}
$link = Director::baseURL() . $shopURL . 'produkt/' . $this->URLSegment;

return $link;
}
public function AbsoluteLink() {
return Director::absoluteURL($this->Link());
}