2017 © Pedro Peláez
 

library l4sacs

SACs: Simple Asset Collections for Laravel 4. Very similar to asset containers in Laravel 3.

image

codenamegary/l4sacs

SACs: Simple Asset Collections for Laravel 4. Very similar to asset containers in Laravel 3.

  • Thursday, May 2, 2013
  • by codenamegary
  • Repository
  • 0 Watchers
  • 0 Stars
  • 222 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CURRENT STATUS: IN DEVELOPMENT / UNSTABLE

Simple Asset Collections for Laravel 4

A Laravel 4 package providing an ultra basic Asset Manager similar to Laravel 3., (*1)

Installation

Via composer / packagist - in composer.json require..., (*2)

::php
"codenamegary/l4blog": "dev-master"

Example usage:

Step 1: Resolve a Shared Instance from the IoC Container

If you have a $app within context you can resolve like so..., (*3)

:::php
$assets = $app['l4sacs'];

If no $app is in context, just call the App facade..., (*4)

:::php
$assets = App::make('l4sacs');

Step 2: Add Assets and Collections

:::php
// Add a stylesheet to the default collection
$assets->addCss(asset('css/styles.css'));
// Add a stylesheet to the header collection, if no 'header'
// collection exists it will be automatically created.
$assets->collection('header')->addCss(asset('css/styles.css'));
// Add a javascript source to the footer collection
$assets->collection('footer')->addJs(asset('js/footerjs.js'));

Step 3: Pass the Assets to your View

:::php
$header = View::make('header')->with('assets',$assets);

Step 4: Render Assets inside your View

:::php
// Render stylesheet elements for the 'header' collection
$assets->collection('header')->render('css');
// Render script elements for the footer collection
$assets->collection('footer')->render('js');
// Or recursively render everything, including any sub-collections
$assets->render('css',true);
$assets->render('js',true);

The Versions

02/05 2013

dev-master

9999999-dev

SACs: Simple Asset Collections for Laravel 4. Very similar to asset containers in Laravel 3.

  Sources   Download

MIT

The Requires

 

by Gary Saunders

laravel asset

02/05 2013

dev-dev

dev-dev

SACs: Simple Asset Collections for Laravel 4. Very similar to asset containers in Laravel 3.

  Sources   Download

MIT

The Requires

 

by Gary Saunders

laravel asset