Download the PHP package quanzo/yii2-resource-collector without Composer
On this page you can find all versions of the php package quanzo/yii2-resource-collector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quanzo/yii2-resource-collector
More information about quanzo/yii2-resource-collector
Files in quanzo/yii2-resource-collector
Package yii2-resource-collector
Short Description Connecting resources defined with views for Yii 2
License MIT
Informations about the package yii2-resource-collector
resourseCollector module for Yii 2
-
The module allows you to set styles and scripts for each template. To do this, set two files with the template name and with the extensions css and / or js. In such resources relative links cannot be used.
-
Each type of resource is combined into a file. These files are placed in a folder, available for web service. And these resources are connected to the page.
-
Compression of other resources into one file is available.
-
Scss files will be converted to css. Customization required.
- Marking resources as preload is supported (https://developer.mozilla.org/ru/docs/Web/HTML/Preloading_content).
--------------------------------------------------------------------------
-
Модуль позволяет задавать к каждому шаблону стили и скрипты. Для этого задаются два файла с именем шаблона и с расширениями css и/или js. В таких ресурсах нельзя использовать относительные ссылки.
-
Каждый тип ресурсов объединяется в файл. Эти файлы размещаются в папку, доступную для вебсервиса. И эти ресурсы подключаются к странице.
-
Доступно сжатие других ресурсов в один файл.
-
Файлы scss будут преобразованы в css. Необходима настройка.
- Поддерживается пометка ресусов, как preload (https://developer.mozilla.org/ru/docs/Web/HTML/Preloading_content).
--------------------------------------------------------------------------
Installation
-
Copy to the folder with modules and connect autoload.php
-
Or use composer: add to the require section of the project
"quanzo/yii2-resource-collector": "*"
orcomposer require "quanzo/yii2-resource-collector"
- Add to configuration
$config = [
'bootstrap' => [
'collector',
],
'modules' => [
'collector' => [
'class' => 'x51\yii2\modules\resourceCollector\Module',
'cacheDir' => 'cache', // sets the name of the folder for saving cached resources (optional)
'optimizeCss' => false, // merge styles files
'optimizeJs' => false, // merge script files
'preload' => [], // or function ():array list of files to preload
'exclude' => [
'*ckeditor*'
], // or function ():array list of mask for exclude from optimize
'scssImportPath' => [], // a list of directories in which files scss for @import will occur
'scssVar' => [], // variables for scss
'scssFunc' => [], // functions for scss
],
]
];
Events
no
Methods
no