ArtiGrid Builder Pro

Complete Documentation — CLI Reference & Visual Builder

Two ways to generate the same ArtiGrid code: from the command line, or visually.

How Arco and ArtiGrid Builder Pro fit together

This documentation covers two tools that produce the same end result — working ArtiGrid code — through two different workflows.

ToolWorkflowBest for
Arco CLI Terminal commands (php arco make:crud …) that scaffold controllers, views, models, routes, and menu items into your project. Repeatable scaffolding, scripting, version-controlled generation, full MVC wiring.
ArtiGrid Builder A visual, point-and-click interface where you configure a table and a render mode, then copy the generated PHP. Exploring options visually, one-off snippets, fine-tuning a single grid before pasting it in.
The same code underneath. Both tools emit ArtiGrid method chains. A command like php arco make:crud Users users --columns=id,name,email --modal produces essentially the same $grid->table('users')->crudCol([...])->modal() chain you would assemble by clicking through the Builder. Learn the chain once and you can read, tweak, or extend output from either tool.

A common flow: use the Arco wizard or make:crud to scaffold the full page and route, then open the Builder when you want to experiment with extra ArtiGrid features (comboboxes, calendar mode, charts) before folding them back into the generated controller.

Part 1 · Arco CLI

The Artigrid command-line console. Run every command from the project root.

Command Overview

Arco is the Artigrid command-line console. Run all commands from the project root:

php arco <command> [arguments] [options]
init

Initializes the project and generates arco.yaml

build

Analyzes and validates all generated artifacts

db

Manages database tables and columns

nav

Manages the navigation menu in the database

list:templates

Lists all generated artifacts

make:controller

Generates Controller + View + registered route

make:model

Generates a PHP Model with basic CRUD methods

make:view

Generates a PHP view inside app/views/

make:crud

Generates a full ArtiGrid CRUD page

make:dashboard

Generates a dashboard with multiple grids

make:stats

Generates a stats panel with metrics and charts

make:login

Generates login + logout + auth guard

make:component

Generates a reusable component

make:grid

Generates a CSS grid layout

make:layout

Generates a reusable master layout

make:interface

Generates a complete interface with sections

make:page

Generates a page with a layout

make:nav-manager

Generates a web-based menu manager

make:wizard

Step-by-step interactive assistant

init

Initializes a new Artigrid project in the current directory. Generates the arco.yaml configuration file and the base folder structure.

php arco init [--name=<name>] [--namespace=<ns>] [--output-dir=<dir>] [--style=css|tailwind|scss] [--engine=html|blade|twig] [-f|--force]

Options

OptionDescriptionDefault
--nameProject nameCurrent directory name
--namespacePHP namespace for the projectApp\Artigrid
--output-dirDirectory where generated artifacts are savedartigrid
--styleStyle system: css, tailwind, or scsscss
--engineTemplate engine: html, blade, or twightml
-f, --forceOverwrite arco.yaml if it already exists without prompting

Folders created

Examples

# Interactive mode (asks questions)
php arco init
# Non-interactive mode
php arco init --name="My App" --namespace="App\\Artigrid" --style=tailwind
# Overwrite existing configuration
php arco init --force

build

Analyzes all generated artifacts in the project (interfaces, pages, layouts, grids, components) and produces a status report with file count and size per type. Optionally validates file integrity.

php arco build [--dry-run] [--validate]

Options

OptionDescription
--dry-runShows what would be analyzed without writing the manifest
--validateVerifies that all files are readable and intact
Output: Generates artigrid/.build.json — a manifest containing the build date, version, project name, and per-type artifact statistics.

Examples

# Standard build (generates manifest)
php arco build
# Preview report only, without writing any files
php arco build --dry-run
# Build with file integrity validation
php arco build --validate

db Database

Manages database tables and columns directly from the console. Create, drop, and modify tables without needing a SQL client.

php arco db <action> [table] [options]

Available actions

ActionDescription
tablesLists all tables with their column count and row count
show <table>Shows the full structure of a table (DESCRIBE)
create <table>Creates a new table with columns defined via options or interactively
drop <table>Drops a table (asks for confirmation)
add-column <table>Adds a column to an existing table
drop-column <table>Removes a column from an existing table

Options for create

OptionDescriptionExample
-c, --columnsColumns in name:type:options format, comma-separatedname:varchar(100):not_null,age:int
--timestampsAutomatically adds created_at and updated_at columns
--soft-deleteAdds a deleted_at column for soft deletes
-f, --forceExecutes without asking for confirmation

Options for add-column

OptionDescriptionDefault
--columnName of the new columnAsked interactively
--typeSQL type: varchar(N), int, text, decimal(10,2), etc.varchar(255)
--nullableColumn allows NULL valuesNOT NULL
--defaultDefault value for the column
--afterInsert column after another one (--after=name)End of table
--uniqueAdds a UNIQUE index to the column

Examples

# List all tables
php arco db tables
# Show table structure
php arco db show users
# Create a table with all columns in one command
php arco db create employees \
  --columns="name:varchar(100):not_null,email:varchar(200):unique,role:varchar(50)" \
  --timestamps
# Create a table interactively (step by step)
php arco db create products
# Add a column
php arco db add-column users --column=phone --type=varchar(20) --nullable
php arco db add-column users --column=status --type=tinyint --default=1 --after=email
# Drop a column
php arco db drop-column users --column=phone
# Drop a table without confirmation
php arco db drop users --force
Available column types: int, bigint, tinyint, varchar(N), text, longtext, decimal(10,2), float, double, date, datetime, timestamp, boolean, json, char(N)

list:templates

Lists all artifacts generated by Arco in the current project, showing filename, size, and last modified date, organized by category.

php arco list:templates [-t|--type=interfaces|grids|layouts|pages|components]

Options

OptionDescription
-t, --typeFilter by category: interfaces, grids, layouts, pages, or components. Shows all if omitted.

Examples

# List all artifacts
php arco list:templates
# Components only
php arco list:templates --type=components
# Generated pages only
php arco list:templates --type=pages

make:controller Generates files

Generates a PHP Controller, its corresponding View, registers the route in router.php, and adds the item to the sidebar menu. Optionally generates a Model as well.

php arco make:controller <Name> [-u|--url=<slug>] [-t|--title=<title>] [-i|--icon=<icon>] [--with-grid] [--table=<table>] [--with-model] [--no-nav] [-o|--overwrite]

Arguments and options

ParameterDescriptionDefault
NameController name in PascalCase (e.g. Employees)Required
-u, --urlURL segment for the route (e.g. employees)kebab-case of name
-t, --titleTitle shown in the topbarSame as name
-i, --iconFontAwesome icon for the menufa-table
--with-gridIncludes an ArtiGrid grid in the view and controllerNo
--tableDatabase table name for the grid (--with-grid)snake_case of name
--with-modelAlso generates the NameModel.php fileNo
--no-navDoes not register the item in the sidebar menuRegisters by default
-o, --overwriteOverwrites existing filesNo

Generated files

Examples

# Basic controller
php arco make:controller Employees --icon=fa-users
# With an ArtiGrid grid connected to a table
php arco make:controller Products --with-grid --table=products --icon=fa-box
# With grid and model
php arco make:controller Clients --with-grid --table=clients --with-model --icon=fa-building
# Without registering in the sidebar menu
php arco make:controller Reports --no-nav

make:model Generates files

Generates a standalone PHP Model with complete CRUD methods: all(), find(), where(), create(), update(), delete(), count(), and paginate().

php arco make:model <Name> [-t|--table=<table>] [-o|--overwrite]

Options

ParameterDescriptionDefault
NameModel name in PascalCase (e.g. Employee, Product)Required
-t, --tableDatabase table namesnake_case of name + 's'
-o, --overwriteOverwrite if already existsNo

Included methods

Examples

# Model with automatically inferred table name (employees)
php arco make:model Employee
# Model with an explicit table name
php arco make:model Product --table=products

make:view Generates files

Generates a PHP view inside app/views/. Supports three variants: basic, with an ArtiGrid grid placeholder, or with an HTML table.

php arco make:view <path/view> [-t|--title=<title>] [--with-grid] [--with-table] [-o|--overwrite]

Options

ParameterDescriptionDefault
path/viewPath relative to app/views/ (e.g. employees/detail)Required
-t, --titleHeading title for the viewFilename
--with-gridIncludes <?= $grid ?? '' ?> to render an ArtiGrid gridNo
--with-tableIncludes a basic Bootstrap HTML table with dynamic rowsNo
-o, --overwriteOverwrite if already existsNo

Examples

# Basic view
php arco make:view employees/detail --title="Employee Detail"
# View with an ArtiGrid grid placeholder
php arco make:view reports/sales --with-grid
# View with a dynamic HTML table
php arco make:view dashboard/index --with-table

make:crud Generates files

Generates a complete PHP page with an ArtiGrid CRUD interface for a database table. The most feature-rich command: supports column selection, renaming, field types, comboboxes, validation, WHERE filters, JOINs, nested tables, exports, and more.

php arco make:crud <Name> [table] [options...]

Main options

OptionDescriptionDefault
NameDescriptive name (e.g. Users, ProductList)Required
tableDatabase table (e.g. users). Asked if omitted.snake_case of name
-m, --modeMode: editable (full CRUD), readonly (read-only), queryeditable
-c, --columnsColumns visible in the grid, comma-separatedAll columns
-r, --renameRename columns: --rename=field=Label (repeatable)
--field-typeInput type override: --field-type=status=select (repeatable)Inferred
--comboboxRelational dropdown: --combobox=field=table:value:label
--requiredRequired fields, comma-separatedNone
-w, --whereWHERE filter: --where=status==active (repeatable)
-o, --order-bySort column
--order-dirSort direction: asc or descasc
-p, --per-pageRecords per page10
-e, --exportExport formats: excel, csv, pdf (comma-separated)
--modalUse modals for formsNo
--renderRender mode: crud, onepage, or insertcrud
--nestedNested table: --nested="Label=parent_key:child_table:child_key"
--joinJOIN: --join=local_col=table:foreign_col:LEFT
--no-add / --no-edit / --no-delete / --no-view / --no-searchDisable specific actionsAll enabled
--no-navDo not register in the sidebar menuRegisters
--iconFontAwesome icon for the menufa-table
--overwriteOverwrite existing filesNo

Examples

# Basic CRUD
php arco make:crud Users users
# With selected columns and modal forms
php arco make:crud Products products --columns=id,name,price,stock --modal
# With renaming, combobox, and export
php arco make:crud Employees employees \
  --columns=id,name,email,department_id,status,hire_date \
  --rename=name=Name \
  --rename=department_id=Department \
  --rename=hire_date="Hire Date" \
  --field-type=status=select \
  --field-type=hire_date=date \
  --combobox=department_id=departments:id:name \
  --required=name,email \
  --export=excel,csv \
  --modal
# With WHERE filter and sorting
php arco make:crud Orders orders \
  --where=status==pending \
  --order-by=created_at \
  --order-dir=desc \
  --per-page=20
# With nested child table
php arco make:crud Clients clients \
  --nested="Orders=id:orders:client_id"
# With JOIN
php arco make:crud Users users \
  --join=role_id=roles:id:LEFT \
  --columns=name,email,roles_name
# Read-only with export
php arco make:crud Reports orders --mode=readonly --export=excel,pdf

make:dashboard Generates files

Generates a PHP dashboard with a sidebar, multiple ArtiGrid grids, and optional authentication support. Define several tables that will be displayed as independent sections.

php arco make:dashboard <Name> [-g|--grids=table1:Title1,table2:Title2] [--with-auth] [-o|--overwrite]

Options

OptionDescriptionDefault
NameDashboard name in PascalCase (e.g. AdminPanel)Required
-g, --gridsComma-separated grids in table:Title formatAsked interactively
--with-authIncludes require_once auth.php to protect the dashboardNo
-o, --overwriteOverwrite if already existsNo

Examples

# Dashboard with two grids
php arco make:dashboard AdminPanel --grids=users:Users,orders:Orders
# Dashboard with auth guard
php arco make:dashboard Panel --grids=employees:Employees --with-auth
# Interactive mode (asks grid by grid)
php arco make:dashboard MyPanel
Note: If --with-auth is used, remember to generate the login with php arco make:login.

make:stats Generates files

Generates a complete stats panel with: metric cards (table row counts), a monthly activity chart using ArtiGrid + Chart.js, and a recent records table. Automatically registers the Controller, View, and route.

php arco make:stats <Name> [--metrics=table:Label:icon,...] [--chart-table=table] [--chart-date=column] [--chart-type=bar|line|doughnut] [--recent-table=table] [--recent-cols=col1,col2] [--recent-limit=N] [-u|--url] [-t|--title] [-i|--icon] [--no-nav] [-o|--overwrite]

Options

OptionDescriptionDefault
-m, --metricsTables for count cards: table:Label:icon (comma-separated)
--chart-tableTable for the monthly activity chartFirst metric
--chart-dateDate column to group chart data bycreated_at
--chart-typeChart type: bar, line, or doughnutbar
--recent-tableTable for the recent records sectionFirst metric
--recent-colsColumns to display in the recent records tableid, created_at
--recent-limitNumber of recent records to show8
-u, --urlURL segment for the routekebab-case of name
-t, --titlePanel titleName
--no-navDo not register in the sidebar menuAdded at top of menu

Examples

# Full stats panel
php arco make:stats Dashboard \
  --metrics=users:Users:fa-users,orders:Orders:fa-cart-shopping,products:Products:fa-box \
  --chart-table=orders --chart-date=created_at --chart-type=line \
  --recent-table=users --recent-cols=name,email,created_at
# Minimal panel with a single metric
php arco make:stats Summary --metrics=admin_users:Admins:fa-user-shield

make:login Generates files

Generates a complete authentication system with three files: a login page, a logout handler, and an auth guard.

php arco make:login [-t|--table=users] [-u|--user=email] [-p|--password=password] [-r|--role=role] [--name=name] [--redirect=dashboard.php] [--roles=admin,editor] [-o|--overwrite]

Options

OptionDescriptionDefault
-t, --tableUsers table in the databaseusers
-u, --userColumn containing the username or emailemail
-p, --passwordColumn containing the hashed passwordpassword
-r, --roleRole column for access controlrole
--nameColumn with the user's display name (stored in session)name
--redirectURL to redirect to after a successful logindashboard.php
--rolesAllowed roles, comma-separatedAll roles

Generated files

Examples

# Basic login with defaults
php arco make:login
# Custom login
php arco make:login --table=users --user=email --password=password --redirect=dashboard.php
# Login with role-based access control
php arco make:login --roles=admin,editor
# Protecting a page with the generated guard:
# Add this line at the top of the PHP file:
require_once 'auth.php';

make:component Generates files

Generates a reusable Artigrid component. Supports multiple base types, props, slots, style variants, and optionally a PHP component class.

php arco make:component <Name> [-t|--type=card|nav|modal|table|form|button|hero|sidebar...] [-p|--props=title,subtitle,image] [--slots=header,body,footer] [-v|--variants=primary,secondary] [--php-class] [-o|--overwrite]

Available component types

card, nav, modal, table, form, button, badge, alert, dropdown, tabs, hero, sidebar, header, footer, widget

Options

OptionDescriptionDefault
-t, --typeBase component type (defines suggested props)card
-p, --propsComponent props, comma-separatedAsked interactively
--slotsComponent slots, comma-separated
-v, --variantsStyle variants, comma-separateddefault
--php-classAlso generates a PHP class for the componentNo
-o, --overwriteOverwrite if already existsNo

Examples

# User card component
php arco make:component UserCard --type=card --props=name,avatar,role,email
# Navigation bar with slots and variants
php arco make:component NavBar --type=nav --slots=brand,links,actions --variants=light,dark
# Data table with PHP class
php arco make:component DataTable --type=table --props=columns,rows,sortable --php-class

make:grid Generates files

Generates a reusable CSS grid layout. Supports simple grids, named grid-areas, and responsive breakpoint variants.

php arco make:grid <Name> [-c|--columns=N] [-r|--rows=N] [-a|--areas="header header / sidebar main"] [-g|--gap=1rem] [--responsive] [-o|--overwrite]

Options

OptionDescriptionDefault
-c, --columnsNumber of grid columnsValue from arco.yaml
-r, --rowsNumber of rows (0 = auto height)0
-a, --areasgrid-template-areas definition
-g, --gapGap between grid cells1rem
--responsiveGenerates responsive variants for each breakpoint (sm, md, lg, xl)No

Examples

# Responsive 2-column grid
php arco make:grid TwoColumn --columns=2 --gap=2rem --responsive
# Dashboard with named areas
php arco make:grid Dashboard --areas="header header / sidebar main / footer footer"
# Masonry-style grid
php arco make:grid Masonry --columns=3 --rows=0

make:layout Generates files

Generates a reusable master layout with predefined content regions. Includes presets for the most common application types.

php arco make:layout <Name> [-t|--type=app|marketing|auth|dashboard|minimal] [-r|--regions=header,main,aside,footer] [-o|--overwrite]

Type presets and their default regions

TypeDefault regions
appheader, main, footer
dashboardtopbar, sidebar, main, footer
marketingheader, main, footer
authmain
minimalmain

Examples

php arco make:layout App --type=app --regions=header,main,aside,footer
php arco make:layout Marketing --type=marketing
php arco make:layout Auth --type=auth

make:interface Generates files

Generates a complete large interface with grids, sections, and components. Unlike make:layout, it generates the full visual structure with content sections already in place.

php arco make:interface <Name> [-t|--type=dashboard|admin|landing|portal|app] [-c|--columns=N] [-s|--sections=header,sidebar,main,footer] [--with-nav] [--with-sidebar] [-o|--overwrite]

Default sections by type

TypeDefault sections
dashboardheader, sidebar, main, widgets, footer
admintopbar, sidebar, breadcrumb, content, footer
landinghero, features, pricing, cta, footer
portalheader, nav, hero, cards, footer
appheader, main, aside, footer

Examples

php arco make:interface Dashboard --type=dashboard --with-nav --with-sidebar
php arco make:interface AdminPanel --type=admin --sections=header,sidebar,main,footer
php arco make:interface LandingPage --type=landing --columns=12

make:page Generates files

Generates a complete Artigrid page tied to an existing layout, with URL route support and SEO meta tags.

php arco make:page <Name> [-l|--layout=default] [--title=<title>] [--route=/path/{id}] [--with-meta] [-o|--overwrite]

Options

OptionDescriptionDefault
-l, --layoutLayout name to use, or a relative pathdefault
--titleHTML page titlePage name
--routeURL route (e.g. /users/{id})/kebab-case-of-name
--with-metaIncludes full SEO meta tags (og:, twitter:, etc.)No

Examples

php arco make:page Home --layout=marketing --title="Welcome" --with-meta
php arco make:page UserProfile --layout=app --route="/users/{id}"

make:nav-manager Navigation Generates files

Generates a full web-based manager for the sidebar menu (nav_items). Create, edit, delete, and reorder menu items directly from the browser without touching the database manually.

php arco make:nav-manager [-u|--url=nav-manager] [-t|--title="Menu Manager"] [-i|--icon=fa-sitemap] [--no-nav] [-o|--overwrite]

Options

OptionDescriptionDefault
-u, --urlURL segment for the manager pagenav-manager
-t, --titleTitle shown in the topbarMenu Manager
-i, --iconFontAwesome iconfa-sitemap
--no-navDo not add the manager to the sidebar menuAdded by default

Web manager features

Examples

# With defaults
php arco make:nav-manager
# With custom URL and title
php arco make:nav-manager --url=menu --title="System Menu"

make:wizard Interactive Database

A step-by-step interactive assistant for creating a complete CRUD manager. Guides the user through numbered questions, can create the database table if it does not exist, and generates all MVC files in a single session.

php arco make:wizard
Accepts no command-line options. Everything is configured interactively through 14 numbered questions.

Wizard steps

StepQuestion
Manager name (e.g. Employees, Products)
Database table name
Create the table if it does not exist? (define columns interactively)
Title shown in the topbar
FontAwesome icon
Use modal forms?
Columns to show in the grid
Enable export? (excel, csv, pdf)
Sort column
Records per page
Disable any actions? (add, edit, delete, view, search)
Add a nested child table?
Add to the sidebar menu?
Also generate a PHP Model?

Generated files

Available column types when creating a table

string (VARCHAR 255), text, integer, bigint, decimal (10,2), boolean, date, datetime, time, json, float

Usage

php arco make:wizard
Recommended for new users. The wizard is the fastest way to create a complete manager including a database table, without needing to remember any options.

Part 2 · ArtiGrid Builder Pro

The visual code generator for ArtiGrid CRUD interfaces — configure, preview, copy.

Introduction Visual Builder

ArtiGrid Builder Pro is a visual code generator that creates PHP code for ArtiGrid CRUD interfaces without manual coding. It provides an intuitive drag-and-drop interface where you configure database tables, fields, validation rules, and rendering modes—then instantly generates production-ready PHP code.

Key Benefit: Reduce development time from hours to minutes by visually configuring your CRUD interfaces, then copying the generated code into your application.
Relationship to Arco CLI: The code the Builder produces is the same ArtiGrid method chain that make:crud and friends scaffold from the terminal. Use the Builder to explore and fine-tune; use the CLI to scaffold the surrounding MVC files and routes.

What Problems Does It Solve?

How ArtiGrid Builder Works

ArtiGrid Builder follows a simple workflow:

Workflow:
1. Select your database table from the dropdown
2. Choose a render mode (CRUD, Form, Calendar, Login, or Chart)
3. Configure mode-specific settings (columns, fields, validation)
4. Review the generated PHP code in real-time
5. Copy the code and paste it into your project

Interface Components

The Builder interface is divided into three main areas:

ComponentPurposeLocation
Form SectionVisual configuration panel for selected render modeLeft side (70% width)
Preview SectionLive preview of how the grid/form will appearRight side (30% width)
Code OutputGenerated PHP code ready to copyBelow preview or separate tab

Five Render Modes

ArtiGrid Builder supports five different rendering modes, each designed for specific use cases:

📊

CRUD

Full data grid with create, read, update, delete operations

📝

Form

Standalone insert/edit form without the grid view

📅

Calendar

Event calendar view with drag-drop and color coding

🔐

Login

Authentication form with custom styling options

📈

Chart

Data visualization with multiple chart types

CRUD Mode

CRUD (Create, Read, Update, Delete) mode generates a complete data management interface with a sortable, filterable data grid and built-in forms for editing records.

Features Available

Configuration Steps

  1. Select Table: Choose your database table from the dropdown
  2. Choose Columns: Select which columns appear in the grid
  3. Define Form Fields: Pick fields that appear in insert/edit forms
  4. Set Validation: Mark fields as required or add custom validation
  5. Configure Actions: Choose which actions (view, edit, delete) are enabled
  6. Review Code: Copy the generated PHP code

Generated Code Example

$grid = new ArtiGrid();
$grid->table('employees')
    ->template('bootstrap5')
    ->perPage(10)
    ->required(false)
    ->validation_required(['firstName','lastName'])
    ->crudCol(['employeeNumber','firstName','lastName','email'])
    ->formFields(['employeeNumber','firstName','lastName','email','officeCode'])
    ->modal();
echo $grid->render();

Form Mode (Insert Only)

Form mode generates a standalone insert form without displaying the data grid. This is ideal for dedicated data entry pages or when you want to focus the user's attention on completing a form.

Use Cases

Configuration Options

OptionDescriptionDefault
Form FieldsWhich columns appear as form inputsAll columns
Required FieldsFields that must be filled before submissionNone
Field GroupingOrganize fields into logical sectionsNo grouping
Redirect on SuccessURL to navigate to after form submissionReload page
Custom Button TextLabel for the submit button"Submit"

Generated Code Example

$grid = new ArtiGrid();
$grid->table('orders')
    ->template('bootstrap5')
    ->required(false)
    ->validation_required(['customerNumber','orderDate','status'])
    ->formFields(['customerNumber','orderDate','status','comments'])
    ->modal();
echo $grid->render('insert');

Calendar Mode

Calendar mode generates an interactive calendar interface for tables with date fields, like events, appointments, or tasks. It supports drag-and-drop, color coding, and custom color pickers.

Essential Configuration

FieldDescriptionRequired
Title FieldColumn displayed as event titleYes
Start FieldColumn containing the event start dateYes
End FieldColumn containing the event end dateNo
Color FieldColumn for event color codesNo
All Day FieldBoolean column for all-day eventsNo

Color Picker Configuration

Enable the optional color picker for users to assign colors to events:

Generated Code Example

$grid = new ArtiGrid();
$grid->table('appointments')
    ->template('bootstrap5')
    ->calendarTitle('title')
    ->calendarStart('start_date')
    ->calendarEnd('end_date')
    ->calendarColor('color')
    ->calendarAllDay('all_day')
    ->calendarView('dayGridMonth')
    ->calendarLocale('en')
    ->colorPicker('color', ['#3788d8','#28a745','#dc3545'], 'fixed');
echo $grid->render('calendar');

Login Mode

Login mode generates a user authentication form that validates credentials against a database table. It supports custom HTML styling and optional server-side validation callbacks.

Configuration Options

Tip: Always use password hashing (password_hash) in your database. The Builder generates validation code that uses password_verify() for secure comparison.

Optional Features

FeatureDescription
Custom TemplateHTML form layout with placeholders {user}, {password}, {action}
Validation CallbackServer-side PHP function to verify credentials
Session ManagementAutomatic session creation on successful login
RBAC SupportRole-based access control via callbacks

Generated Code Example

$grid = new ArtiGrid();
$grid->table('users')
    ->template('bootstrap5')
    ->required(false)
    ->validation_required(['username','password'])
    ->formFields(['username','password']);
echo $grid->render('select');

Chart Mode

Chart mode generates data visualizations from your database. It supports multiple chart types and dynamic SQL-based datasets, allowing you to create real-time dashboards without extra charting libraries.

Supported Chart Types

Dataset Configuration

Each chart can have multiple datasets. For each dataset you configure:

PropertyDescription
LabelName appearing in the chart legend
Data SourceStatic array or SQL query (prefix with #)
Background ColorFill color with optional transparency
Border ColorLine/border color for the dataset
Border WidthThickness of lines in pixels

Dynamic SQL Datasets

You can load chart data directly from the database by prefixing the query with a hash (#):

# Example: Dynamic dataset
#select SUM(amount) from orders where orderDate >= DATE_SUB(NOW(), INTERVAL 30 DAY)

Generated Code Example

$grid = new ArtiGrid();
$grid->table('sales')
    ->template('bootstrap5');
$grid->chart_labels(
    ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
    [
        [
            'label' => 'Sales Volume',
            'data' => '#select COUNT(*) from sales where MONTH(date) IN (1,2,3,4,5)',
            'backgroundColor' => 'rgba(55, 136, 216, 0.2)',
            'borderColor' => 'rgba(55, 136, 216, 1)',
            'borderWidth' => 1
        ]
    ],
    'bar'
);
$grid->chart_view(true);
echo $grid->render();
Same as the CLI: make:stats emits this exact chart_labels() pattern for its monthly activity chart — the Builder just lets you assemble it visually first.

Code Generation & Export

After configuring your settings, ArtiGrid Builder generates production-ready PHP code that you can immediately use in your application.

The Generated Code Includes

Copying and Using Generated Code

  1. Click the "Copy Code" button in the preview area
  2. Paste into your PHP file that requires ArtiGrid.php
  3. Ensure your database credentials are configured in your db.php
  4. Test the generated interface in your browser
  5. Customize further using ArtiGrid methods if needed
Pro Tip: Generated code is a starting point. You can extend it with additional ArtiGrid methods like combobox(), fieldCondition(), callbacks(), etc., to add more functionality beyond what the Builder provides.

Best Practices

1. Start Simple, Then Extend

Use the Builder to generate the basic CRUD grid, then enhance it with advanced features using direct ArtiGrid method calls in your code.

2. Validate Field Types

Ensure your database schema has appropriate column types (VARCHAR, DATE, INT, etc.) so the Builder can correctly infer validation rules and input types.

3. Plan Form Field Grouping

Before generating code, decide which fields belong together logically. Use the Builder's field arrangement feature to organize them into sections.

4. Use Modal Forms for CRUD

For standard CRUD operations, enable modal forms to keep users focused on the grid without page navigation.

5. Test Generated Code Immediately

Copy the generated code and test it right away to ensure it works in your environment before making further modifications.

6. Keep Builder Configuration Stable

Avoid frequently switching tables in the Builder. Generate code for one table at a time, and organize your generated scripts logically in your project.

7. Combine with ArtiGrid Methods

The Builder generates basic code. Enhance it with ArtiGrid's advanced features:

Security Considerations

⚠️ Important: ArtiGrid Builder exposes your database schema via SHOW TABLES and displays column names. Never expose the Builder to untrusted users or on public-facing servers.

Protecting the Builder

Always follow these security practices when deploying ArtiGrid Builder:

  1. Restrict Access: Place the Builder behind user authentication. Only developers should access it.
  2. Development Environment Only: Use the Builder only in development or staging environments, never in production.
  3. Database Credentials: Ensure your db.php file uses secure, limited credentials—not the production admin account.
  4. Rename the Builder: Consider renaming builder.php to something non-obvious, or use a URL rewrite to limit access.
  5. Disable in Production: Remove or disable the Builder entirely from production deployments.
  6. Access Logs: Monitor access logs for unauthorized Builder usage attempts.

Generated Code Security

The generated code itself follows best practices:

Additional Recommendations