PHP code example of tom.kiernan / salsa

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

    

tom.kiernan / salsa example snippets


$Salsa = new Salsa\Salsa( array( "baseRoute" => "test/route/ ) ); // Set base route for woking in sub directories

$Salsa->addRoute( "/", "test" ); // Ouputs "test"

$Salsa->addRoute( "name/:name", function( $name ) { echo $name  } ) // example "name/tomkiernan" will output "tomkiernan"

$Salsa->run(); // actually runs the router;