-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFoundationAsset.php
38 lines (33 loc) · 1.05 KB
/
FoundationAsset.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* FoundationAsset - defines the AssetBundle for Foundation resources
*
* @link http://www.foundationize.com/#yii2
*/
namespace shqear\foundation6;
use yii\web\AssetBundle;
use yii\web\View;
class FoundationAsset extends AssetBundle
{
// JS awesomeness: http://www.jsdelivr.com/projects/foundation
public function init()
{
\Yii::$app->view->registerJs('$(document).foundation();', View::POS_READY);
// The core Foundation CSS
// if language is arabic, include rtl foundation
if (substr(\Yii::$app->language, 0, 2) == 'ar') {
$this->css[] = 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.0/foundation-rtl.min.css';
} else {
$this->css[] = 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.0/foundation.min.css';
}
parent::init();
}
public $css;
public $js = [
'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.0/foundation.min.js',
];
// Depends on jQuery
public $depends = [
'yii\web\JqueryAsset'
];
}