kaistaerk/ajax-flash-message-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kaistaerk/ajax-flash-message-bundle

最新稳定版本:2.1.1

Composer 安装命令:

composer require kaistaerk/ajax-flash-message-bundle

包简介

Handle ajax flash messages for symfony 5

README 文档

README

Symfony bundle to handle symfony flash messages called by ajax actions

Bundle will catch all FlashBag messages set in ajax actions in controllers when send an request via jquery and display it as it would show flash messages used in normal symfony controller actions. You can override flash message styles as you wish. At the moment they should look quite user friendly/UX.

Step 1: Install package

composer req kaistaerk/ajax-flash-message-bundle

Step 2: Install assets

php app/console assets:install public --symlink --relative

If your public directory is not public please modify the command above.

Step 3: Include the messages template

In layout file:

{{ include('@AjaxFlashMessage/Messenger/messages.html.twig') }}

Step 4: add assets to your main layout file

Add jQuery as well if it's not already done.

{% block javascripts %}
    // ...
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript"></script>
    <script src="{{ asset('bundles/ajaxflashmessage/js/jquery.flash-messenger.js') }}" type="text/javascript"></script>
{% endblock %}
{% block stylesheets %}
    // ...
    <link href="{{ asset('bundles/ajaxflashmessage/css/flash-message.css') }}" type="text/css" rel="stylesheet" />
{% endblock %}

Usage

Add this call to a script block in your layout or to some of your templates:

<script>
$('#flash-messages').flashNotification('init');
</script>

统计信息

  • 总下载量: 275
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-06