ereminmdev/yii2-notyf

为 Yii 框架提供替代确认消息。

安装: 43

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

v1.0.4 2023-10-23 05:56 UTC

This package is auto-updated.

Last update: 2024-09-07 12:53:13 UTC


README

为 Yii 框架提供替代警报 - 成功 - 错误 - 警告 - 信息 - 确认消息。

基于 JavaScript 库: https://github.com/caroso1222/notyf

安装

composer require --prefer-dist ereminmdev/yii2-notyf

文档

https://github.com/caroso1222/notyf#global-configuration

使用

在视图中使用

<?php

NotyfAsset::register($this);

$this->registerJs('
// Create an instance of Notyf
var notyf = new Notyf();

// Display an error notification
notyf.error("You must fill out the form before moving forward");

// Display a success notification
notyf.success("Your changes have been successfully saved!");

');
?>