-
Notifications
You must be signed in to change notification settings - Fork 3
Helper to load assets into your project(Javascript and CSS)
williamhrs/Assets-Helper
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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') ?>" />
About
Helper to load assets into your project(Javascript and CSS)
Resources
Stars
Watchers
Forks
Packages 0
No packages published