GithubHelp home page GithubHelp logo

dqesupport / turbolinksbundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from helthe/turbolinksbundle

0.0 1.0 0.0 36 KB

Turbolinks implementation for your Symfony2 project

License: MIT License

PHP 100.00%

turbolinksbundle's Introduction

Helthe Turbolinks Bundle Build Status Scrutinizer Quality Score

The HeltheTurbolinksBundle integrates the Helthe Turbolinks Component with your Symfony2 application.

Installation

Step 1: Add package requirement in Composer

Manually

Add the following in your composer.json:

{
    "require": {
        // ...
        "helthe/turbolinks-bundle": "~1.1"
    }
}

Using the command line

$ composer require 'helthe/turbolinks-bundle=~1.1'

Step 2: Register the bundle in the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Helthe\Bundle\TurbolinksBundle\HeltheTurbolinksBundle(),
    );
}

Step 3: Add Composer scripts for automatic installation of assets

{
   "scripts": {
       "post-install-cmd": [
           "Helthe\\Bundle\\TurbolinksBundle\\Composer\\ScriptHandler::installAssets"
       ],
       "post-update-cmd": [
           "Helthe\\Bundle\\TurbolinksBundle\\Composer\\ScriptHandler::installAssets"
       ]
   }
}

Usage

To start using turbolinks, all you need to do is add the turbolinks javascript to your layout.

Both the original coffeescript version and compiled version of each script are available for use.

Inserting the javascript in your layout

Directly

<script src="{{ asset('bundles/heltheturbolinks/js/turbolinks.js') }}"></script>

Using Assetic

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

Using jquery.turbolinks

If you need to use jquery.turbolinks, you need to add it before turbolinks.js

Compatibility

Turbolinks is designed to work with any browser that fully supports pushState and all the related APIs. This includes Safari 6.0+ (but not Safari 5.1.x!), IE10, and latest Chromes and Firefoxes.

Do note that existing JavaScript libraries may not all be compatible with Turbolinks out of the box due to the change in instantiation cycle. You might very well have to modify them to work with Turbolinks' new set of events. For help with this, check out the Turbolinks Compatibility project.

Additional Resources

Please refer to the turbolinks and jquery.turbolinks projects if you require additional information on the javascript libraries.

You will find additional documentation with the turbolinks component documentation.

Bugs

For bugs or feature requests, please create an issue.

turbolinksbundle's People

Contributors

carlalexander avatar cordoval avatar acidjames avatar pborreli avatar draczris avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.