PHP code example of kayladnls / seesaw

1. Go to this page and download the library: Download kayladnls/seesaw 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/ */

    

kayladnls / seesaw example snippets


  $seesaw = new Seesaw();
  $seesaw->addNamedRoute('JimBob', 'GET', 'url/jim/bob', function(){});
  echo $this->route('JimBob'); // will output: /url/jim/bob

$seesaw->setBaseUrl('http://yolo.com');
$seesaw->addNamedRoute('JimBob', 'GET', 'url/jim/bob', function(){});
echo $this->route('JimBob'); // will output http://yolo.com/url/jim/bob

$seesaw->setBaseUrl('http://yolo.com');
$seesaw->addNamedRoute('JimBob', 'GET', 'url/jim/bob', function(){});
echo $this->route('JimBob')->secure(); // will output https://yolo.com/url/jim/bob
echo $this->route('JimBob')->relative(); // will output /url/jim/bob

$seesaw->addNamedRoute('JimBob', 'GET', 'url/jim/bob/{id}', function(){});
echo $seesaw->route('JimBob', [123]); // will output /url/jim/bob/123;