PHP code example of fherryfherry / super-framework-engine
1. Go to this page and download the library: Download fherryfherry/super-framework-engine 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/ */
fherryfherry / super-framework-engine example snippets
$results = db()->raw("SELECT * FROM users WHERE age > ?", [25])->fetchAll();
namespace App\Models;
use SuperFrameworkEngine\App\UtilModel\Model;
class User extends Model
{
protected ?string $table = 'users';
public $id;
public $name;
public $email;
}
// Simpan data baru
$user = new User();
$user->name = "Ferry";
$user->save();
// Update data
$user = User::findById(1);
$user->name = "Updated Name";
$user->save();
// Hapus data
User::delete(1);
// Pagination
$data = User::paginate(15); // Mengembalikan array ['data' => [...], 'total' => 100, 'links' => '...']
use SuperFrameworkEngine\Foundation\Container;
$container = Container::getInstance();
// Binding
$container->singleton(MyService::class, fn() => new MyService());
// Resolving
$service = $container->make(MyService::class);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.