Absolute url in presenter
Notice: This thread is very old.
- dimkalinux
- Member | 24
Nette 2.0.11
- How in presenter receive $baseUrl or how create absolute url in $this->link()? I found this way – but this ugly.
$url = $this->context->getByType('Nette\Http\IRequest')->getUrl();
$targetUrl = rtrim($url->getBaseUrl(), '/') . $this->link('Item:get');
- How correctly pass to presenter variables from config?
public function renderAdd()
{
$nginxCacheLifetime = (string) $this->context->parameters["nginxCache"]["homepageLifetime"];
$this->context->httpResponse->setHeader('X-Accel-Expires', $nginxCacheLifetime);
}
- Oli
- Member | 1215
- I guess, it can work just with
//
, like: $this->link(‘//Item:get’). If it doesnt work, you should try, switch to absolute url in every links by
$this->absoluteUrls = true;