Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MinifyTemplates.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Deploy\Service;
7 
10 
15 {
19  private $filesUtils;
20 
24  private $htmlMinifier;
25 
30  public function __construct(
31  Files $filesUtils,
32  MinifierInterface $htmlMinifier
33  ) {
34  $this->filesUtils = $filesUtils;
35  $this->htmlMinifier = $htmlMinifier;
36  }
37 
43  public function minifyTemplates()
44  {
45  $count = 0;
46  foreach ($this->filesUtils->getPhtmlFiles(false, false) as $template) {
47  $this->htmlMinifier->minify($template);
48  $count++;
49  }
50  return $count;
51  }
52 }
$count
Definition: recent.phtml:13
__construct(Files $filesUtils, MinifierInterface $htmlMinifier)
$template
Definition: export.php:12