mazedlx/asset_helper

Asset helper for CodeIgniter 2 and 3

v2.0.1 2016-01-23 16:58 UTC

This package is auto-updated.

Last update: 2024-12-16 03:16:19 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Build Status Scrutinizer Code Quality

asset_helper

Super-simple asset helper for CodeIgniter for local js and css files.

Installation

composer require mazedlx/asset_helper

Usage

Make sure that CodeIgniter ist autoloading your Composer packages (application/config/config.php):

$config['composer_autoload'] = true;

In your view:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$assetHelper = new AssetHelper\AssetHelper();
?>
<!DOCTYPE html>
<html lang="de">
    <head>
	    <base href="<?php echo base_url(); ?>" />
	    <?php echo $assetHelper->link_css('bootstrap.css'); ?>
	    <?php echo $assetHelper->link_js('jquery.min.js'); ?>
	    <?php echo $assetHelper->link_js('bootstrap.js'); ?>
	</head>
	<body>
        <h1>Lorem ipsum dolor sit amet</h1>
	</body>
</html>