PHP code example of mochrira / selvi-framework

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

    

mochrira / selvi-framework example snippets


 

namespace App\Controllers;
use Selvi\Controller;

class HomeController extends Controller {

    function index() {
        return response('Welcome to Selvi Framework');
    }

}




ting\Route::get('/', 'App\\Controllers\\HomeController@index');
Selvi\Framework::run();



ASEPATH', __DIR__); // tambahkan baris ini
meController@index');
\Selvi\Framework::run();



return function ($schema, $direction) {
    if($direction == 'up') :
        $schema->create('kontak', [
            'idKontak' => 'INT(11) PRIMARY KEY AUTO_INCREMENT',
            'nmKontak' => 'VARCHAR(150)',
            'nomor' => 'VARCHAR(50)'
        ]);
    endif;

    if($direction == 'down') :
        $schema->drop('kontak');
    endif;
};