/Assets-Helper

Helper to load assets into your project(Javascript and CSS)

Primary LanguagePHP

Helper to load Assets to your project.

To use this helper you must create a public folder into your home directory.

public/
public/css
public/js


You may use a different folder, and set it up on your "assets.php" file inside the config folder.

In order to use it you can do like this:

$data['css'] = load_css('global.css');
// -- OR --
$data['css'] = load_css(array('global.css','page.css'));
// -- OR --
$data['css'] = load_css(array(
	array('screen.css', 'screen, projection'),
	array('print.css', 'print'),
));

$data['js'] = load_js(array('js1.js','js2.js'));

$this->load->view('example',$data);


example.php
<head>
<?php echo $js; ?>
<?php echo $css; ?>
</head>

To load an image you can use <img src="<?php echo load_img('flowers.jpg') ?>" />