1. Go to this page and download the library: Download fgh151/core-assets library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/**
* @author : Fedor B Gorsky
*/
namespace app\assets\site;
use fgh151\core\assets\Asset;
use fgh151\core\assets\BootstrapAsset;
use fgh151\core\assets\FontAwesomeAsset;
class SiteAsset extends Asset
{
//Подключаем стили
public static $css = [
__DIR__ . '/css/main.css',
];
//Подключаем стили с внешних ресурсов
public static $externalCss = [
'https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,800',
];
//Подключаем скрипты с внешних ресурсов
public static $externalJs = [
'//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js'
];
//Подключаем скрипты
public static $js = [
__DIR__ . '/js/script.js',
];
//Указываем зависимости
public static $depends = [
BootstrapAsset::class,
FontAwesomeAsset::class
];
}
use app\assets\site\SiteAsset;
Yii::$app->clientScript->register(SiteAsset::class);
use app\assets\site\SiteAsset;
Yii::app()->clientScript->register(SiteAsset::class);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.