1. Go to this page and download the library: Download aimanong/thinkphp 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/ */
namespace app;
use Aimanong\Resource;
class CustomerResource extends Resource
{
public static function model(): string { return Customer::class; }
public static function label(): string { return '客户'; }
public static function uri(): string { return 'customers'; }
public static function grid(\Aimanong\Grid\Grid $grid): void
{
$grid->column('id', 'ID')->sortable();
$grid->column('name', '名称')->searchable();
}
public static function form(\Aimanong\Form\Form $form): void
{
$form->text('name')->label('名称')->
use Aimanong\Aimanong;
public function register(): void
{
Aimanong::registry()->register(CustomerResource::class);
}