| Recommend this page to a friend! | 
|  Download | 
| Info | Documentation |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 185 | All time:  8,657 This week: 47  | ||||
| Version | License | PHP version | Categories | |||
| assetinc 1.0.2 | MIT/X Consortium ... | 5.4 | HTML, PHP 5, Files and Folders, Traits | 
| Description | Author | |
| This package can add common JavaScript and CSS assets to a Web page. | 
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.
composer require gavinggordon/assetinc
include_once( __DIR__ . '/vendor/autoload.php' );
$JSasset = \GGG\AssetInc\AssetInc::init( 'js' );
$CSSasset = \GGG\AssetInc\AssetInc::init( 'css' );
$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
$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
|  Files (13) | 
| File | Role | Description | ||
|---|---|---|---|---|
|  src (1 file, 1 directory) | ||||
|  tests (1 file) | ||||
|  .scrutinizer.yml | Data | Auxiliary data | ||
|  .travis.yml | Data | travis.ci | ||
|  composer.json | Data | composer file | ||
|  phpunit.xml | Data | Auxiliary data | ||
|  README.md | Doc. | Description & Examples | ||
|  Files (13) | / | src | / | Assets | 
| File | Role | Description | ||
|---|---|---|---|---|
|  Abstracts (1 file) | ||||
|  Interfaces (1 file) | ||||
|  Traits (2 files) | ||||
|  Css.php | Class | Class | ||
|  Js.php | Class | Class | ||
|  Files (13) | / | src | / | Assets | / | Traits | 
| File | Role | Description | 
|---|---|---|
|  ScriptVendors.php | Class | Trait | 
|  StyleVendors.php | Class | Trait | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.