| Recommend this page to a friend! |
| Info | Documentation | 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
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Data | travis.ci | |||
| Data | composer file | |||
| Data | Auxiliary data | |||
| Doc. | Description & Examples | |||
| / | src | / | Assets |
| File | Role | Description | ||
|---|---|---|---|---|
| |
Class | Class | ||
| |
Class | Class | ||
| / | src | / | Assets | / | Traits |
| File | Role | Description |
|---|---|---|
| |
Class | Trait |
| |
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. |
| 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.