Download the PHP package diecoding/yii2-toastr without Composer
On this page you can find all versions of the php package diecoding/yii2-toastr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-toastr
Yii2 Toastr
Simple flash toastr notifications for Yii2
Yii2 Toastr uses Toastr library
Demo: https://codeseven.github.io/toastr/demo.html
Table of Contents
- Yii2 Toastr
- Table of Contents
- Installation
- Dependencies
- Usage
- Layouts/Views
- Basic Usage
- Advanced Configuration
- Controllers
- Simple Flash Messages
- Multiple Messages
- Messages with Titles (\< v1.4.0)
- Advanced Usage with Custom Options (≥ v1.4.0)
- Complex Example with Multiple Messages
- Testing
- Code Quality
- Contributing
- License
Installation
Install via Composer:
Or add to your composer.json
:
Dependencies
- PHP 7.4+
- yiisoft/yii2 (≥2.0.14)
- npm-asset/toastr
Usage
Layouts/Views
Add ToastrFlash
widget to your layout file (e.g., views/layouts/main.php
):
Basic Usage
Advanced Configuration
Controllers
Use the standard Yii2 flash message system:
Simple Flash Messages
Multiple Messages
Messages with Titles (< v1.4.0)
Advanced Usage with Custom Options (≥ v1.4.0)
Complex Example with Multiple Messages
Testing
Run the test suite using PHPUnit:
The test suite covers:
- ✅ ToastrBase - Base widget functionality and constants
- ✅ Toastr - Main notification widget properties and methods
- ✅ ToastrFlash - Flash message integration
- ✅ ToastrAsset - Asset bundle configuration
Coverage Requirements:
- Target: >80% code coverage
- Supports PHP 7.4, 8.0, 8.1, 8.2, 8.3
- Automated testing via GitHub Actions
Code Quality
This project maintains high standards through automated quality checks:
- PHP CodeSniffer - PSR-12 coding standards
- PHP CS Fixer - Modern PHP code formatting
- PHPStan - Static analysis (level 5)
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run quality checks (
composer quality
) - Run tests (
composer test
) - Commit your changes (
git commit -am 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Requirements:
- Write tests for new features
- Follow PSR-12 coding standards
- Ensure all quality checks pass
- Update documentation as needed
License
This package is open-source software licensed under the MIT License.
Author: Sugeng Sulistiyawan
Copyright: © 2018-2025 Sugeng Sulistiyawan
Built with ❤️ for the Yii2 community.