-
Notifications
You must be signed in to change notification settings - Fork 2
Load from a Config file
Junaid Atari edited this page Aug 24, 2016
·
2 revisions
Info: Before you start, make sure you have read the Quick Start guide.
- Create a new file:
@app/config/cdn-config.phpand open it in code editor. - Now paste the following code:
return [
'font-awesome' => [
'css' => [
[
'font-awesome.min.css', // offline version
'@cdn' => '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css', // online version
]
]
]
];- Open
@app/config/main.phpin code editor. - Add a new propery
configsundercdncomponent like the following code:
// ...
'components' => [
// ...
'cdn' => [
//...
'configs' => [
// -------------------------
// List of config files
// -------------------------
// You can use Yii Alias too
'@app/config/cdn-config.php',
// or an absolute path
// dirname(__FILE__) .'/cdn-config.php'
],
//...
],
// ...
],
// .../*
~ Register assets
*/
$cdn->get('font-awesome')->register();Copyright (c) 2016 Junaid Atari and it's contributes.