1. Go to this page and download the library: Download roolith/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/ */
roolith / framework example snippets
namespace App\Models;
class User extends Model
{
protected $table = 'users';
}
namespace App\Controllers;
use App\Models\User;
class WelcomeController extends Controller
{
public function index()
{
$data = [
'content' => 'Welcome to Roolith framework!',
'title' => 'Roolith Framework',
];
return $this->view('home', $data);
}
public function users()
{
return User::all();
}
public function show($id)
{
return User::orm()->find($id);
}
}