Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
View
Asset
PreProcessor
Minify.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Asset\PreProcessor
;
7
8
use
Magento\Framework\Code\Minifier\AdapterInterface
;
9
use
Magento\Framework\View\Asset\Minification
;
10
use
Magento\Framework\View\Asset\PreProcessor
;
11
use
Magento\Framework\View\Asset\PreProcessorInterface
;
12
16
class
Minify
implements
PreProcessorInterface
17
{
21
protected
$adapter
;
22
26
protected
$minification
;
27
32
public
function
__construct
(
AdapterInterface
$adapter
,
Minification
$minification
)
33
{
34
$this->adapter =
$adapter
;
35
$this->minification =
$minification
;
36
}
37
44
public
function
process
(PreProcessor\
Chain
$chain)
45
{
46
if
($this->minification->isEnabled(pathinfo($chain->getTargetAssetPath(), PATHINFO_EXTENSION)) &&
47
$this->minification->isMinifiedFilename($chain->getTargetAssetPath()) &&
48
!$this->minification->isMinifiedFilename($chain->getOrigAssetPath())
49
) {
50
$content
= $this->adapter->minify($chain->getContent());
51
$chain->setContent(
$content
);
52
}
53
}
54
}
Magento\Framework\View\Asset\Minification
Definition:
Minification.php:16
Magento\Framework\Code\Minifier\AdapterInterface
Definition:
AdapterInterface.php:16
Magento\Framework\View\Asset\PreProcessor\Minify\$minification
$minification
Definition:
Minify.php:26
Magento\Framework\View\Asset\PreProcessor\Minify
Definition:
Minify.php:16
Magento\Framework\View\Asset\PreProcessor\Minify\process
process(PreProcessor\Chain $chain)
Definition:
Minify.php:44
Magento\Framework\View\Asset\PreProcessor
Magento\Framework\View\Asset\PreProcessor\Minify\$adapter
$adapter
Definition:
Minify.php:21
$content
$content
Definition:
downloadable_product_with_files_and_sample_url.php:93
Magento\Framework\View\Asset\PreProcessor\Minify\__construct
__construct(AdapterInterface $adapter, Minification $minification)
Definition:
Minify.php:32
Magento\Framework\View\Asset\PreProcessorInterface
Definition:
PreProcessorInterface.php:14
Magento\Framework\View\Asset\PreProcessor\Chain
Definition:
Chain.php:18