mazedlx / asset_helper
Asset helper for CodeIgniter 2 and 3
v2.0.1
2016-01-23 16:58 UTC
Requires
- php: >=5.3.0
README
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>