Download the PHP package tomkirsch/crud without Composer
On this page you can find all versions of the php package tomkirsch/crud. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package crud
ci4-crud
A focused set of base classes and helpers for building structured CRUD applications in CodeIgniter 4.\ Designed to reduce repetition in models, entities, joins, form handling, and timezone-aware date workflows.
Contents
BaseModel.phpBaseEntity.phpdate_helper.phpform_helper.php
BaseModel
Extends CodeIgniter\Model and adds higher-level utilities for
relational CRUD workflows.
Key Features
- Automatic prefixing of primary/created/updated/deleted fields
- Option to derive
$allowedFieldsfrom$validationRules columns()helper based on validation rulesnextAutoIncrement()(MySQL information_schema lookup)- Smart
save()override (prevents empty PK from forcing update) syncOneToMany()for maintaining lookup tables- Join utilities with automatic unique field aliasing
- Subquery helpers for selecting values from latest related rows
Join Workflow
joinModel() registers fields with unique aliases.\
selectUnique() builds a collision-safe SELECT clause.
Example:
Supports aliasing and prefix mapping for nested joins.
Sync Lookup Tables
Handles insert + delete diff automatically.
BaseEntity
Extends CodeIgniter\Entity\Entity and improves form and join handling.
Key Features
fillNullEmpty()--- converts empty strings to NULL before fill- Timezone helpers:
applyLocalTimezone()applyServerTimezone()
csvMap()--- converts GROUP_CONCAT CSV fields into structured objects/entitiesprefixMap()--- extracts prefixed join fields into sub-entitiesstripAliasPrefix()--- removes select alias prefixesgetHtmlData()--- exports entity attributes as HTMLdata-*attributes
Example:
date_helper
Helpers for timezone-aware date handling using CodeIgniter\I18n\Time.
Functions:
localDate($dateTime, $format = null, $timezone = null)serverDate($dateTime, $format = null, $timezone = null)
Supports returning either a Time object or formatted string.
Requires:
in Config/App.php.
form_helper
Improves CI form value binding for objects/entities.
Handles:
- NULL vs empty
- Boolean fields
- DateTime / Time objects
- Bracketed input names (
user[email]) - Optional local timezone conversion
Key functions:
set_value_from()set_checkbox_from()set_select_from()set_radio_from()set_textarea_from()
Example:
With date formatting:
Installation
Drop the classes into an autoloaded namespace and register via PSR-4 in
Config/Autoload.php.
Place helpers in app/Helpers/ and load with:
Notes
- Call
reset()when using the unique join workflow before building a new query. - Ensure
syncOneToMany()receives specific WHERE conditions in$common_data.