PHP code example of bookfrank / viaduct

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

    

bookfrank / viaduct example snippets


composer 


use \Bookfrank\Viaduct\Router;

Router::get('hello', function(){
	echo "Hello viaduct";
});

Router::get('profile/{uid}', function($uid){
	echo "Present userid is ".$uid;
});

Router::get('blog/{id}', "\Foo\Bar\FooController@bar");

Router::dispatch();


class FooController{
	public function bar($id){
    	echo "id is ".$id;
    }
}