2017 © Pedro Peláez
 

library assetinc

A PHP class which provides simple javascript or css asset inclusion.

image

gavinggordon/assetinc

A PHP class which provides simple javascript or css asset inclusion.

  • Sunday, September 18, 2016
  • by gavinggordon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

AssetInc

Build Status, (*1)

This class (GGG\AssetInc\AssetInc) provides a simple and quick way to include/add JS or CSS assets to an HTML document's head and/or body., (*2)

Installation

composer require gavinggordon/assetinc

Examples

Instantiation:

include_once( __DIR__ . '/vendor/autoload.php' );

$JSasset = \GGG\AssetInc\AssetInc::init( 'js' );

$CSSasset = \GGG\AssetInc\AssetInc::init( 'css' );

JS:

$JSasset->insert( 'jquery' );
// Result: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

$JSasset->add_asset( ASSET_NAME, ASSET_URL );
$JSasset->insert( ASSET_NAME );
// Result: ASSET_URL

CSS:

$CSSasset->insert( 'font-awesome' );
// Result: <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">

$CSSasset->add_asset( ASSET_NAME, ASSET_URL );
$CSSasset->insert( ASSET_NAME );
// Result: ASSET_URL

View this class package on PHPClasses.org., (*3)

The Versions

18/09 2016

dev-master

9999999-dev http://assetinc.gavingordon.com

A PHP class which provides simple javascript or css asset inclusion.

  Sources   Download

MIT

The Development Requires

css php javascript html js link include stylesheet script v1.0.1 assetinc

08/04 2016

1.0.1

1.0.1.0 http://assetinc.gavingordon.com

A PHP class which provides simple javascript or css asset inclusion.

  Sources   Download

MIT

The Development Requires

css php javascript html js link include stylesheet script v1.0.1 assetinc

08/04 2016

1.0.0

1.0.0.0 http://includer.gavingordon.com

A PHP class which provides simple javascript or css asset inclusion.

  Sources   Download

MIT

The Development Requires

css php javascript html js link stylesheet script v1.0.0 includer