承接 manuelj555/ajax-flash-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

manuelj555/ajax-flash-bundle

Composer 安装命令:

composer require manuelj555/ajax-flash-bundle

包简介

Symfony ManuelAjaxFlashBundle

README 文档

README

This Bundle Allow the Process of Flashes in ajax request via Javascript. Require jQuery.

Installation

Add to composer.json:

{
  "require": {
    "manuelj555/ajax-flash-bundle": "1.0.*@dev"
  }
}

Execute composer update.

Configuration

Register the bundle:

<?php
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Manuelj555\Bundle\AjaxFlashBundle\ManuelAjaxFlashBundle(),
        // ...
    );
}

In the config.yml (All config is Optional):

manuel_ajax_flash:
    auto_assets:
        pnotify: ~
#        sticky: ~
    mapping:
#        success:
#            title: Información
#            icon: my-icon
#        info:
#            title: Información

auto_assets

Auto add the javascript and css in the html content. You have select the plugin to use, the available options are:

mapping

Allow set the title, icon and type for use in javascript, for each setted mapping type.

Example:

manuel_ajax_flash:
    mapping:
        success:
             type: success
             title: Información
             icon: my-icon
         info:
             type: info
             title: Información
         error:
             type: danger
             title: Error

Manual Assets Instalation

If you no enable the auto_assets config, you can use the twig view located in the bundle:

  • ManuelAjaxFlashBundle::pnotify.html.twig or
  • ManuelAjaxFlashBundle::sticky.html.twig

Example of use:

{% use 'ManuelAjaxFlashBundle::pnotify.html.twig' %}
{#{% use 'ManuelAjaxFlashBundle::sticky.html.twig' %}#}
<!DOCTYPE html>
<html>
    <head>
        ...
        
        {{ block('ajax_flash_css') }}
    </head>
    <body>
        ...
        
        {{ block('ajax_flash_js') }}
        {{ block('ajax_flash_plugin') }}
    </body>
</html>

Javascript Plugin

Usage:

$.ajaxFlash('*', function (message, type, title, icon) {
    //call on all flash types. this function is called for each flash message
    //the message parameter is a string
});
$.ajaxFlash('success info', function (message, type, title, icon) {
    //call on success and info flash types. this function is called for each flash message
    //the message parameter is a string
});
$.ajaxFlash('error', function (message, type, title, icon) {
    //call on error flash type. this function is called for each flash message
    //the message parameter is a string
});

// Working with array messages:

$.ajaxFlash(function (messages, type, title, icon) {
    //call in all flash types, this function is called one time for each message type.
    //the messages parameter is an array.
});

$.ajaxFlash(function (messages, type, title, icon) {
    //call success and info flash types, this function is called one time for each message type.
    //the messages parameter is an array.
}, 'success info');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固