PHP code example of mmollay / gridkit

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

    

mmollay / gridkit example snippets




use GridKit\Table;

$table = new Table('products');
$table->query($db, "SELECT * FROM products ORDER BY name")
    ->search(['name', 'sku'])
    ->column('name', 'Product', ['sortable' => true])
    ->column('sku', 'SKU', ['width' => '120px'])
    ->column('price', 'Price', ['format' => 'currency', 'sortable' => true])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->button('edit', ['icon' => 'edit', 'modal' => 'edit_product'])
    ->modal('edit_product', 'Edit', 'forms/product.php', ['size' => 'medium'])
    ->newButton('New Product', ['modal' => 'edit_product'])
    ->paginate(25)
    ->render();
bash
cp gridkit/skeleton.php my-app/index.php

gridkit/
├── autoload.php           # PSR-4 Autoloader
├── skeleton.php           # Starting point for new projects
├── GRIDKIT_SKILL.md       # Agent Skill for AI assistants
├── src/                   # PHP components
├── css/
│   ├── gridkit.css        # Core styles
│   └── themes.css         # All themes + dark mode
├── js/
│   └── gridkit.js         # Vanilla JS (event delegation)
└── demo/
    └── index.php          # Live demo of all components