PHP code example of longtimejones / toucanine

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

    

longtimejones / toucanine example snippets




$app->route('GET /', function () use ($app) {
    echo 'Hello, world!';
});

$app->dispatch();

$app->route('GET /hello-world', array(
    'Welcome',    /* App controller */
    'helloWorld', /* Controller method */
));

$app->route('GET /hello-user/([^/]+)', array(
    'Welcome',   /* App controller */
    'helloUser', /* Controller method */
    '$1',        /* Argument passed to method */
));

$this->helper('Html')->purifier()->purify($value);

$this->model('User')->byUsername($user)->first()

$this->controller('NameOfYourAppController')->invoke('nameOfControllerMethod', array(
    $argument1,
    $argument2,
    ...
));

$app->route('POST /example/id/([^/]+)', function () use ($app) {
    ...
});

app/Config.php