PHP code example of green-spot / pachira-idiorm
1. Go to this page and download the library: Download green-spot/pachira-idiorm 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/ */
green-spot / pachira-idiorm example snippets
get("/", function(){
$users = orm("users")->find_many();
view("top", ["users" => $users]);
});
Pachira::run([
"view" => [
"directory" => __DIR__ . "/views/"
],
"idiorm" => [
"schema" => "mysql:host=localhost:;dbname=test",
"configure" => [
"username" => "user",
"password" => "pass",
]
]
]);