承接 valantir/ajaxenginebundle 相关项目开发

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

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

valantir/ajaxenginebundle

Composer 安装命令:

composer require valantir/ajaxenginebundle

包简介

Engine to sends all requests to server via ajax

README 文档

README

#AjaxEngineBundle

##Installation

Step 1

To install bundle in your project, add below line to your composer.json file:

// composer.json
{
    // ...
    "require": {
        // ...
        "valantir/ajaxenginebundle": "dev-master"
    }
}

NOTE: Please replace dev-master with the latest stable version, for example 1.0.1.

Then install bundle by running update command:

$ php composer.phar update valantir/ajaxenginebundle

Now you need to add bundle to your AppKernel.php file:

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Valantir\AjaxEngineBundle\AjaxEngineBundle(),
    // ...
);

Step 2 (optional)

If you want to flash messages will be send to browser as header add below code to your config.yml file.

ajax_engine:
    flash_messages:
        type: header #header or html - if header then flash messages are in header "Flash-Messages" in json format

Step 3

Now each template files need to extends layout.html.twig file existing in AjaxEngineBundle. Add this line to first line in your file

{% extends "AjaxEngineBundle::layout.html.twig" %}

All content need to be in content block like this:

{% block content %}
    {# your twig code #}
{% endblock content %}

Support

Bundle uses jQuery 1.11.2 and modernizr in version 2.8.3.

Tested on :

  • Chrome 43,
  • FireFox 38,
  • Opera 30.0,
  • Safari 5.1.7,
  • IE 11

Events

Event name Description Parameters
beforeAddClass calls before engine add class "engine-on" to links and forms -
afterAddClass calls after engine add class "engine-on" to links and forms -
beforeDone calls before ajax done function - before data from request will be added to ajax-container parameters = [{'response': response, 'status': status, 'xhr': xhr}]
afterDone calls after ajax done function - after data from request will be added to ajax-container parameters = [{'response': response, 'status': status, 'xhr': xhr}]
beforeAlways calls before ajax always function parameters = [{'response': response, 'status': status, 'xhr': xhr}]
afterAlways calls after ajax always function parameters = [{'response': response, 'status': status, 'xhr': xhr}]
beforeSend calls before ajax beforeSend function parameters = [{'xhr': xhr: 'settings': settings}]

统计信息

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

GitHub 信息

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

其他信息

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