/

XcrudConfig Reference

Every setting in src/Config.php, plus the static helper methods available on Xcrud itself.

Database connection

PropertyTypeDefaultDescription
$dbHoststring'localhost'MySQL/MariaDB host.
$dbNamestring-Database name.
$dbUserstring-Database user.
$dbPassstring-Database password.
$dbCharsetstring'utf8mb4'Connection charset, used to build the PDO DSN via XcrudConfig::dsn().

UI & interface

PropertyTypeDefaultDescription
$uistring'tailwind'Theme switch - 'none', 'tailwind', or 'bootstrap'. See Choosing a UI Framework.
$langstring''Default UI language code. '' means the built-in English strings baked into xcrud.js. A non-empty code must have a matching languages/{code}.ini; a page's own ->set_lang() overrides this.
$columnVisibilityTogglebooltrueAdds a "Columns" toolbar toggle letting the operator show/hide grid columns at will. Site-wide only, no per-page override.
$buttonTextbooltrueWhether row action buttons (Edit/Remove/every ->button()) show icon+label, or icon-only with a hover tooltip. A table's own ->button_style() can override this per table.
$loadingIndicatorstring'text''text' (a "Processing…" label), 'bar' (a shared page-top progress bar), or 'spinner' (a small spinning icon) while a grid loads.
$intelligentColumnFitbooltrueSite-wide default for hiding overflow columns behind a per-row expand toggle on narrow containers. Per-page overridable via ->intelligent_column_fit().
$intelligentColumnArrangementbooltrueSite-wide default for reflowing each row into a stacked card on phone-width screens. Per-page overridable via ->intelligent_column_arrangement().

See Intelligent Column Fit & Arrangement for the last two in detail.

Pagination, export & import

PropertyTypeDefaultDescription
$perPageint10Default rows-per-page.
$perPageOptionsarray[10, 25, 50, 100]Selectable page sizes shown in the "rows per page" control.
$exportRowLimitint50000Max rows a single CSV/XLSX/PDF export request will fetch, regardless of how many rows actually match the current filter.
$importRowLimitint5000Max data rows a single CSV import request will insert. Kept far lower than $exportRowLimit - each row runs its own insert plus hooks.
$autocompleteLimitint8Max live suggestions shown under the search box as the user types.

See Exporting CSV, XLSX & PDF.

Demo & playground

PropertyTypeDefaultDescription
$demobooltrueEnables a "View Code" button on every Add/Edit form, showing the raw PHP source of the page that defined it. Turn off in production - see Deploying to Production.

Third-party libraries

$libraries is an array of CDN (or local libs/) URLs that progressively enhance certain fields. If a URL fails to load, the field falls back to its native HTML control instead of breaking:

KeyPowers
flatpickr_js / flatpickr_cssRicher date/datetime picker on date fields.
quill_js / quill_csschange_type('field', 'editor') - the rich text (WYSIWYG) editor.
choices_js / choices_cssSearchable/taggable dropdowns for ->relation(..., search: true).
cropper_js / cropper_cssThe interactive drag-to-crop UI for change_type('field', 'image', '', ['manual_crop' => true]).

Uploads

PropertyTypeDefaultDescription
$uploadDirstring'media/'Where uploaded files are written (relative to the project root) - also the URL path they're served from.
$uploadMaxSizeint10 * 1024 * 1024 (10MB)Max upload size in bytes, enforced on top of whatever php.ini's own upload_max_filesize/post_max_size already cap.
$uploadAllowedImageExtarray['jpg','jpeg','png','gif','webp']Allowed image extensions, checked against both filename and actual detected image data.
$uploadAllowedFileExtarray['pdf','doc','docx','xls','xlsx','ppt','pptx','txt','csv','zip','mp3','mp4']Allowed generic file extensions.
$uploadAllowedVideoExtarray['mp4','webm','ogg']Allowed video extensions.

See File & Image Uploads.

Static helper methods on Xcrud

MethodDescription
Xcrud::humanize(string $field): stringTurns a camelCase or snake_case field name into a Title Case label - e.g. 'customerNumber'/'payment_date' become "Customer Number"/"Payment Date". A bare "id" word is upper-cased to "ID".
Xcrud::html(string $html, ?string $text = null): arrayWraps trusted markup so a column_callback() return renders as real HTML in the grid instead of being escaped as plain text. See Custom Cell Rendering: Badges & Avatars.
Xcrud::uiAssets(): stringEmits the active theme's theme.js tag plus any extra CDN/font <head> assets, for a widget-less page that still wants the theme's JS globals.
Xcrud::assetVersion(string $path): stringReturns a ?v=<mtime> cache-busting query string for a static asset this project owns (not for CDN libraries, which are already versioned by URL).
echo Xcrud::humanize('paymentDate'); // "Payment Date"

// inside a column_callback():
return Xcrud::html('<span class="badge">Paid</span>');