showErrorsAsCSS() public method

Render errors as a pseudo-element within valid CSS, displaying the errors on any page that includes this CSS.
public showErrorsAsCSS ( boolean $show = true )
$show boolean
コード例 #1
0
 /**
  * @param string $rootScssDirectory
  * @param TwigThemeConfig $themeConfig
  * @param string | null $formatter
  * @param string | null $cacheDir
  */
 public function __construct($rootScssDirectory, TwigThemeConfig $themeConfig, $formatter = 'compressed', $cacheDir = null)
 {
     $scssImportPaths = $themeConfig->getScssImportPaths();
     $scssCompiler = new Compiler();
     $scssCompiler->setImportPaths($scssImportPaths);
     $this->salt = $formatter . $rootScssDirectory . json_encode($scssImportPaths);
     switch ($formatter) {
         case 'expanded':
             $scssCompiler->setFormatter(\Leafo\ScssPhp\Formatter\Expanded::class);
             break;
         case 'compact':
             $scssCompiler->setFormatter(\Leafo\ScssPhp\Formatter\Compact::class);
             break;
         case 'compressed':
             $scssCompiler->setFormatter(\Leafo\ScssPhp\Formatter\Compressed::class);
             break;
     }
     $this->server = new Server($rootScssDirectory, $cacheDir, $scssCompiler);
     $this->server->showErrorsAsCSS(true);
 }