Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CssInliner.php
Go to the documentation of this file.
1 <?php
7 
9 use Pelago\Emogrifier;
10 
15 {
19  private $emogrifier;
20 
24  public function __construct(State $appState)
25  {
26  $this->emogrifier = new Emogrifier();
27  $this->emogrifier->setDebug($appState->getMode() === State::MODE_DEVELOPER);
28  }
29 
36  public function setHtml($html)
37  {
38  $this->emogrifier->setHtml($html);
39  }
40 
47  public function setCss($css)
48  {
49  $this->emogrifier->setCss($css);
50  }
51 
57  public function disableStyleBlocksParsing()
58  {
59  $this->emogrifier->disableStyleBlocksParsing();
60  }
61 
68  public function process()
69  {
70  return $this->emogrifier->emogrify();
71  }
72 }