Created
November 21, 2017 10:57
-
-
Save azazqadir/2be72c03c92cc0a1af332f36d6dc1a75 to your computer and use it in GitHub Desktop.
CDN Integration in Yii 2 App. Using CloudwaysCDN to call CSS file from CDN. Full article at: https://www.cloudways.com/blog/cdn-in-yii2/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
'components' => [ | |
// ... | |
'cdn' => [ | |
'class' => '\yii2cdn\Cdn', | |
'baseUrl' => defined ('YII2CDN_OFFLINE') | |
? 'http://localhost/yii2/cdn' | |
: '//71265-358070-raikfcquaxqncofqfm.stackpathdns.com/cdn', | |
'basePath' => dirname(__DIR__, 2) . '/cdn', | |
'components' => [ | |
'font-awesome' => [ | |
'css' => [ | |
[ | |
// local version | |
'font-awesome.min.css', | |
// cdn version | |
'@cdn' => '//71265-358070-raikfcquaxqncofqfm.stackpathdns.com/cdn/font-awesome/css/font-awesome.min.css', | |
] | |
] | |
] | |
], | |
], | |
// ... | |
], | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment