2017 © Pedro Peláez
 

library assets

The description of the module

image

arrounded/assets

The description of the module

  • Saturday, March 12, 2016
  • by Anahkiasen
  • Repository
  • 3 Watchers
  • 1 Stars
  • 1,627 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Arrounded/Assets

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage, (*1)

Install

Via Composer, (*2)

``` bash $ composer require arrounded/assets, (*3)


## Usage ### Assets pipeline To use the assets pipeline create a `config/assets.php` file. In it you can define various collection of assets: ```php <?php return [ 'global' => [ 'css' => [ 'foo.css', ], ], 'admin' => [ 'css' => ['admin.css'], 'js' => ['admin.js'], ], ];

Add its service provider in config/app.php, (*4)

Arrounded\Assets\ServiceProvider::class,

Then add the facade in the same file:, (*5)

'Assets' => Arrounded\Assets\Facades\Assets::class,

Now in your views you can call this class to output a collection of assets:, (*6)

{{ Assets.styles('global') }}
{{ Assets.scripts('admin') }}

AssetsReplacer

When going to production, you don't want to leave the Assets.styles and Assets.scripts calls as is as they will return the assets individually. The AssetsReplacer class will replace these calls with their actual values so usemin can read them and consume them., (*7)

$replacer = new AssetsReplacer($assetsHandler);
$replacer->replaceInFolder('resources/views');

JavascriptBridge

This is a class to pass data to the front-end. You can pass it as globals or namespaced. It's a static class so you can call it anywhere:, (*8)

JavascriptBridge::add(['foo' => 'bar']);
JavascriptBridge::render(); // var foo = "bar";

JavascriptBridge::setNamespace('Arrounded');
JavascriptBridge::add(['foo' => 'bar']);
JavascriptBridge::render(); // var Arrounded = {}; Arrounded.foo = "bar";

It can also render classes implementing the Jsonable interface., (*9)

Testing

bash $ composer test, (*10)

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

12/03 2016

dev-master

9999999-dev

The description of the module

  Sources   Download

MIT

The Requires

 

The Development Requires

by Madewithlove

laravel assets usemin

12/03 2016

2.0.0

2.0.0.0

The description of the module

  Sources   Download

MIT

The Requires

 

The Development Requires

by Madewithlove

laravel assets usemin

19/06 2015

1.0.1

1.0.1.0

The description of the module

  Sources   Download

MIT

The Requires

 

The Development Requires

by Madewithlove

laravel assets usemin