Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michalsn/codeigniter-htmx-alerts
A simple Alerts class integrated with htmx and Alpine.js for CodeIgniter 4 framework.
https://github.com/michalsn/codeigniter-htmx-alerts
alpinejs codeigniter codeigniter4 htmx
Last synced: 3 months ago
JSON representation
A simple Alerts class integrated with htmx and Alpine.js for CodeIgniter 4 framework.
- Host: GitHub
- URL: https://github.com/michalsn/codeigniter-htmx-alerts
- Owner: michalsn
- License: mit
- Created: 2024-09-11T05:54:39.000Z (5 months ago)
- Default Branch: develop
- Last Pushed: 2024-09-26T11:27:46.000Z (4 months ago)
- Last Synced: 2024-10-01T11:01:34.773Z (4 months ago)
- Topics: alpinejs, codeigniter, codeigniter4, htmx
- Language: PHP
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeIgniter Htmx Alerts
A simple Alerts class integrated with [htmx](https://htmx.org) and [Alpine.js](https://alpinejs.dev) for CodeIgniter 4 framework.
[![PHPUnit](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/phpunit.yml/badge.svg)](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/phpunit.yml)
[![PHPStan](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/phpstan.yml/badge.svg)](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/phpstan.yml)
[![Deptrac](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/deptrac.yml/badge.svg)](https://github.com/michalsn/codeigniter-htmx-alerts/actions/workflows/deptrac.yml)
[![Coverage Status](https://coveralls.io/repos/github/michalsn/codeigniter-htmx-alerts/badge.svg?branch=develop)](https://coveralls.io/github/michalsn/codeigniter-htmx-alerts?branch=develop)![PHP](https://img.shields.io/badge/PHP-%5E8.1-blue)
![CodeIgniter](https://img.shields.io/badge/CodeIgniter-%5E4.3-blue)## Installation
composer require michalsn/codeigniter-htmx-alerts
## Configuration
You have to publish the config file first:
php spark alerts:publish
Now you can change:
#### $key
Alerts key name used in views and session.
#### $displayTime
The default alert display time in milliseconds.
#### $types
The array of message types, where array key is a CSS class and value is the title of the alert type.
Array keys are also used to determine the type of the alert we want to set, ie:
```php
alerts()->set('success', 'Success message goes here.');
```#### $htmlWrapperId
Wrapper `id` name, used in the view file.
#### $views
View files used by this library. You can change them to reflect the current style/theme you're using.
The default view files are designed to play along with [Tabler](https://tabler.io/admin-template) theme.
## Usage
In your main layout place the code (usually it will be just before the closing `