定制 kaistaerk/ajax-flash-message-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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>

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固