PHP code example of surda / back-button

1. Go to this page and download the library: Download surda/back-button library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

surda / back-button example snippets


use Nette\Application\UI\Presenter;
use Surda\BackButton\InjectBackButton;

abstract class ProductPresenter extends Presenter
{
    use InjectBackButton;
}

$this->template->destination = $this->link('detail', $id);
html
<a n:href="detail $id, destination => $currentLink">Detail</a>
html
<a n:href="default, destination => NULL">Products</a>