PHP code example of thephprame / thephprame-core

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

    

thephprame / thephprame-core example snippets


class HomeController extends Controller
{
    public function index()
    {
        return Response::view('home', ['name' => 'world']);
    }
}

class User extends Model
{
    protected $table = 'users';
}

$user = (new User())->find(1);

Routes::get('/', [HomeController::class, 'index']);
Routes::post('/api/items', [ItemController::class, 'store']);

$name = Request::input('name', 'guest');
return Response::json(['hello' => $name]);