2017 © Pedro PelĂĄez
 

library assetrinc

An unusually simple way to include assets

image

assetrinc/assetrinc

An unusually simple way to include assets

  • Sunday, June 10, 2018
  • by zacharyrankin
  • Repository
  • 2 Watchers
  • 5 Stars
  • 799 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 6 Open issues
  • 20 Versions
  • 6 % Grown

The README.md

assetrinc

assetrinc /aˈsentrik/ An unusually simple way to compile and serve web assets, (*1)

Installation

The recommended method for installing assetrinc is via Composer. If you are not familiar with Composer, check out the Composer documentation., (*2)

Assetrinc's package name is assetrinc/assetrinc., (*3)

It is highly recommended that you require a specific version of assetrinc in your composer.json for now. That is, do not include 0.0.* or ~0.0.6, but instead include 0.0.6. Assetrinc is still undergoing research and development, so backwards incompatible changes are still likely to occur between versions., (*4)

Basic Usage

Manifest Files

Manifest files are CSS and JS files with special comments that list CSS or JS files to include., (*5)

Assetrinc uses Sprocketeer to parse manifest files. Sprocketeer manifest files are similar to Ruby's Sprockets library manifest files, but keep in mind that Sprocketeer simplifies behavior by using named category paths instead of search paths., (*6)

Example Code

<?php

require 'vendor/autoload.php';

use Assetrinc\AssetService;

$asset_service = new AssetService(
    // the category paths to use when loading manifest files
    array(
        'core' => __DIR__ . '/assets',
        'bower' => __DIR__ . '/bower_components',
    ),
    // the base route assets are served from
    '/assets',
    array('debug' => false)
);

// in the controller that serves your /assets/{name} route
header("Content-Type: " . $asset_service->getContentType($name));
echo $asset_service->getContent($name);

// in your templates, generate JS/CSS tags using
echo $asset_service->jsTag("core/application.js");
echo $asset_service->cssTag("core/application.css");

Contributors

Project Leaders, (*7)

The Versions

10/06 2018

dev-master

9999999-dev http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

12/04 2018

dev-issue-15-upgrade-uglifyjs2

dev-issue-15-upgrade-uglifyjs2 http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

18/12 2014

dev-precompile_features

dev-precompile_features http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

16/12 2014

dev-issue_12_precompile_service

dev-issue_12_precompile_service http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

12/12 2014

dev-issue_6_file_cache

dev-issue_6_file_cache http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

11/05 2014

v0.4.1

0.4.1.0 http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

15/04 2014

v0.4.0

0.4.0.0 http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

12/04 2014

v0.3.0

0.3.0.0 http://github.com/assetrinc/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric

11/04 2014

v0.2.0

0.2.0.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

09/04 2014

v0.1.1

0.1.1.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

08/04 2014

v0.1.0

0.1.0.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

28/03 2014

v0.0.9

0.0.9.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

25/03 2014

v0.0.8

0.0.8.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

20/03 2014

v0.0.7

0.0.7.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster

13/03 2014

v0.0.6

0.0.6.0 http://github.com/lightster/assetrinc

An unusually simple way to include assets

  Sources   Download

The Requires

 

php assets assentric lightster