-
Notifications
You must be signed in to change notification settings - Fork 4
Loading assets
edmundask edited this page Dec 13, 2011
·
1 revision
There are a few ways you can load assets.
If you have pre-defined assets, you can load them with ease by specifying their name.
Pre-defined assets:
jquery:
type: js
minify: false
combine: false
versions:
default: http://ajax.googleapis.com/ajax/libs/jquery/jquery-1.6.4.js
1.5.1: http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js
1.7.1: http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js
style:
type: css
src: less/style.less
minify: false
combine: false
filters: [lessphp]$this->sprinkle->load('jquery');
$this->sprinkle->load('style');
If you have some specific assets that are only loaded on a specific page (and nowhere else), you can define and load css/jss assets manually.
$this->sprinkle->js('http://ajax.googleapis.com/ajax/libs/jquery/jquery-1.6.4.js');
$this->sprinkle->css('less/style.less', 'screen', false, false, array('lessphp'));
Keep in mind that loading assets like this is not recommended as it will be hard to maintain them in the future.