有没有办法在 PHP 应用程序中使用 Toastr 警报?我想使用 Toastr 通知显示成功和错误消息。有没有可用于 php 的库?
javascript
<script type='text/javascript'>
toastr.info('User Registered..!');
</script>
Run Code Online (Sandbox Code Playgroud)
如何仅使用 php 归档此表单?
小智 8
首先,您必须在标头中添加 Toastr CSS、JS 和 jquery。
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/css/toastr.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/js/toastr.js"></script>
Run Code Online (Sandbox Code Playgroud)
然后您可以在任何您想要的地方使用 Toastr 警报。您可以对 PHP 应用程序使用以下方法。
echo '<script type="text/javascript">toastr.success('Have Fun')</script>';
Run Code Online (Sandbox Code Playgroud)
欲了解更多信息:https://github.com/CodeSeven/toastr
| 归档时间: |
|
| 查看次数: |
24720 次 |
| 最近记录: |