lindemannrock / craft-plugin-base
Common utilities and building blocks for LindemannRock Craft CMS plugins
Package info
github.com/LindemannRock/craft-plugin-base
Type:yii2-module
pkg:composer/lindemannrock/craft-plugin-base
5.25.0
2026-05-21 12:59 UTC
Requires
- php: ^8.2
- craftcms/cms: ^5.0.0
- matomo/device-detector: ^6.4
- phpoffice/phpspreadsheet: ^3.0 || ^5.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- phpunit/phpunit: ^11.0
- yiisoft/yii2-redis: ^2.0
This package is auto-updated.
Last update: 2026-05-21 13:00:24 UTC
README
Common utilities and building blocks for LindemannRock Craft CMS plugins.
Features
- Edition Support — standardized Lite/Standard/Pro edition tiers for the Plugin Store
- Settings Traits — database persistence, config file overrides, custom display names
- DateFormatHelper — centralized date/time formatting with timezone-aware SQL expressions
- DateRangeHelper — standardized date range selection, bounds, and query filtering
- ColorHelper — 18-color palette and 15 built-in color sets for consistent styling
- ExportHelper — CSV, JSON, and Excel export with configurable format availability
- GeoHelper — ISO 3166-1 country lookups, dial codes, and phone validation
- DbHelper — DB-agnostic JSON extraction and GROUP_CONCAT
- BooleanHelper — normalize boolean-like config, env, POST, and HTML attribute values
- CsvImportHelper — CSV upload parsing with configurable options
- CpNavHelper — CP subnav building with permission checks
- LabelHelper — strip numbering and truncate long field labels for compact UI contexts (
|lrShortLabelTwig filter) - Device Detection — standardized UA parsing via Matomo DeviceDetector
- GeoLookup — IP geolocation via configurable providers (ip-api.com, ipapi.co, ipinfo.io)
- CP Table Layout — reusable table pages with filters, search, pagination, and AJAX refresh
- CP Analytics Layout — analytics dashboards with tabs, charts, stat boxes, and date filters
- Twig Extensions — 30+ filters and functions for dates, colors, exports, geo, and plugin detection
- 15 Twig Components — badge, stat-box, info-box, export-menu, row-actions, filters, and more
- Testing Utilities —
IntegrationTestCaseabstract base with component swap/restore, generic DB helpers, marker cleanup, queue drain, and an external-state cleanup hook; plus abootstrap()function andphpunit.xml.disttemplate for quick test-suite setup in consumer plugins
Requirements
- PHP 8.2+
- Craft CMS 5.0+
Installation
composer require lindemannrock/craft-plugin-base
Documentation
Full documentation is available in the docs folder.
Support
- Issues: GitHub Issues
- Email: support@lindemannrock.com
License
This plugin is licensed under the MIT License. See LICENSE.md for details.
Developed by LindemannRock