PHPackages                             rft/yii2-alert-modal-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rft/yii2-alert-modal-widget

ActiveYii2-extension

rft/yii2-alert-modal-widget
===========================

A standalone, reusable modal widget for Yii2 Framework with SweetAlert-like UI for confirmation dialogs.

v1.0.1(3mo ago)07MITPHP

Since Jan 29Pushed 3mo agoCompare

[ Source](https://github.com/zenjaku/rft-yii2-alert-modal-widget)[ Packagist](https://packagist.org/packages/rft/yii2-alert-modal-widget)[ RSS](/packages/rft-yii2-alert-modal-widget/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Yii2 Alert Modal Widget
=======================

[](#yii2-alert-modal-widget)

A standalone, reusable confirmation modal widget for the Yii2 Framework with SweetAlert-like UI/UX. This widget is completely independent of Bootstrap and includes its own CSS and JavaScript.

Features
--------

[](#features)

- **No Bootstrap Dependency**: Uses custom CSS and JavaScript - no Bootstrap required
- **SweetAlert2-like UI**: Clean, modern interface with centered layout and icons
- **Standalone Implementation**: All styles and scripts are self-contained within the widget
- **Icon Support**: Five icon types (question, warning, success, error, info) with customizable colors
- **Dynamic Content**: Modal content can be customized per trigger via data attributes
- **POST Method Support**: Handles POST requests with CSRF token integration
- **Responsive Design**: Mobile-friendly layout with proper breakpoints
- **Multiple Instances**: Support for different modal types with separate configurations

Installation
------------

[](#installation)

This is an internal widget for your Yii2 application. To use it:

1. Copy the `AlertModalWidget.php` file to your `frontend/components/widgets/` directory
2. Ensure Font Awesome is included in your project (for icons)

**No Bootstrap required!** The widget includes all necessary CSS and JavaScript.

Basic Usage
-----------

[](#basic-usage)

### Step 1: Define Your Modals

[](#step-1-define-your-modals)

Place modal widgets in your view or layout file. Note the button class format:

```

```

### Step 2: Create Trigger Buttons

[](#step-2-create-trigger-buttons)

Create buttons/links with the corresponding CSS class. Use standard Bootstrap classes for your buttons, but add the modal trigger class:

```
