Search code examples
cakephp-3.3

Cakephp: how to get full url to the current request/page


Some body please help me how to get full url i.e with scheme and host of the current page in the view. I tried the following, but didnt return the expected results

$this->request->here; // returns uri plus base path. no host & scheme
$this->request->here(true); // same problem

Solution

  • <?= $this->Url->build(null, true); ?>
    

    Here you are more info:

    http://book.cakephp.org/3.0/en/views/helpers/url.html#generating-urls