PHP code example of dxuartz / nano

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

    

dxuartz / nano example snippets


[database]
host = "127.0.0.1"  ; host do servidor MySQL
user = "root"       ; usuário com acesso ao banco
pass = "pass"       ; senha do usuário
name = "nano"       ; nome do banco de dados
port = "3306"       ; porta do MySQL no servidor
timezone = "-3:00"  ; timezone da sua área


e = \Nano\Route::getInstance();
$route->setRequestMethod( $_SERVER['REQUEST_METHOD'] ?? '' );
$route->setUrl( $_GET['url'] ?? '' );
$route->setViewPath( __DIR__ . '/../src/views/app/' );
$route->setLayout( __DIR__ . '/../src/views/layouts/app.php' );

$route->get( 'people' )->action( '\Controllers\People#list' )->view( 'people/list.php' );
$route->get( 'people/:person_id' )->action( '\Controllers\People#show' )->view( 'people/show.php' );


use Nano\Core\Dao;
rson', 1 );