2017 © Pedro Peláez
 

symfony-bundle jsblock

Collect & render javascripts at the end of your template.

image

fousky/jsblock

Collect & render javascripts at the end of your template.

  • Friday, June 16, 2017
  • by rapemer
  • Repository
  • 1 Watchers
  • 1 Stars
  • 101 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

JSBlockBundle

The Symfony JSBlockBundle gives you a chance to collect javascript across all TWIG templates (e.g. forms) and render them at the end of your layout (or anywhere you want them)., (*1)

Build Status Scrutinizer Code Quality, (*2)

1. Install it by composer

composer require fousky/jsblock

2. Register bundle in Kernel

public function registerBundles()
{
    $bundles = array(
        new Fousky\JSBlockBundle\FouskyJSBlockBundle(),
        // ... your custom bundles
    );

    // ... your custom dev bundles

    return $bundles;
}

3. Render collected javascripts to your main template

I assume you have the main template layout.html.twig, so add {% jsblock 'render' %} before closing </body> tag., (*3)

Of course you can put this tag anywhere you want to render collected javascripts., (*4)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>my page</title>
</head>
<body>




{% jsblock 'render' %}

</body>
</html>

4. Collect javascripts anywhere

Now you can collect javascripts anywhere you want. You have to start collecting by tag: {% jsblock 'start' %} and close it by tag {% jsblock 'stop' %}., (*5)




{% jsblock 'start' %}





{% jsblock 'stop' %}

The Versions

16/06 2017

dev-master

9999999-dev

Collect & render javascripts at the end of your template.

  Sources   Download

MIT

The Requires

 

by Lukáš Brzák

twig extension

16/06 2017

3.0.0

3.0.0.0

Collect & render javascripts at the end of your template.

  Sources   Download

MIT

The Requires

 

by Lukáš Brzák

twig extension

19/03 2017

2.0.0

2.0.0.0

Collect & render javascripts at the end of your template.

  Sources   Download

MIT

The Requires

 

by Lukáš Brzák

twig extension

25/09 2016

1.0.1

1.0.1.0

Collect & render javascripts at the end of your template.

  Sources   Download

MIT

The Requires

 

by Lukáš Brzák

twig extension

25/09 2016

1.0.0

1.0.0.0

Collect & render javascripts at the end of your template.

  Sources   Download

MIT

The Requires

 

by Lukáš Brzák

twig extension