PHP code example of genesis / micro-framework

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

    

genesis / micro-framework example snippets




use Genesis\Microframework\Service\Config;
use Genesis\Microframework\Service\Router;
use Genesis\Microframework\Service\Request;
use App\Controller;

/../src/View/');
$router->dispatchRequest(new Request());

Config::set('db_params', [
    'dbengine' => 'mysql',
    'host' => 'localhost',
    'port' => 3306,
    'dbname' => 'myDB',
    'username' => 'root',
    'password' => 'password'
]);

# src/Controller/Index


namespace App\Controller;

use Genesis\MicroFramework\Controller\BaseController;

/**
 * Index class.
 */
class Index extends BaseController
{
    public function index()
    {
        echo $this->render('index.php', [
            'name' => 'Abdul'
        ]);
    }
}