Get the Referring Page

Get the Referring Page
This allows you to get the page that sent your user to the current page - their last page visited. This can be useful when providing a "Go Back" link or button.
CakePHP3
<?= $this->Html->link(__('Back'), $this->request->referer(), [ 'class'=>'btn btn-primary' ]) ?>