coderspotting/toast-message 问题修复 & 功能扩展

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

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

coderspotting/toast-message

最新稳定版本:1.2

Composer 安装命令:

composer require coderspotting/toast-message

包简介

Easy integration of AlertifyJS.com in Symfony

README 文档

README

A Symfony Bundle to integrate alertify.js (https://alertifyjs.org/) into your project.

Installation

composer require coderspotting\toast-message

Configuration

The bundle comes with an integrated version of Alertify.js. You can include that version by adding the following snippet to your Twig template. Optionally you can leave this out and include your own version of Alertify.js.

{% stylesheets filter='cssrewrite' 'bundles/coderspottingtoastmessage/css/*' %}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}

Similarly the snippet below will load the included version of Alertify.js in your Twig template. Optionally you can replace this with your own version of Alertify.js.

{% javascripts '@CoderSpottingToastMessageBundle/Resources/public/js/*' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

Regardless if you included the builtin version or your own version of Alertify.js you have to include the following in your Twig template, after the inclusion of the Javascript.

{{ renderToasts() }}

Usage

Retrieve the service and add a toast message as shown below. You can add multiple toast messages. The next rendering of a Twig template will include the toast messages and show them in the browser.

$toastService = $this->container->get('CoderSpotting.ToastMessage');

$toastService->addToast("This is a toast message");

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-07