vendor/fullpipe/twig-webpack-extension/src/Fullpipe/TwigWebpackExtension/WebpackExtension.php line 38

  1. <?php
  2. namespace Fullpipe\TwigWebpackExtension;
  3. use Fullpipe\TwigWebpackExtension\TokenParser\EntryTokenParserCss;
  4. use Fullpipe\TwigWebpackExtension\TokenParser\EntryTokenParserJs;
  5. use Twig\Extension\AbstractExtension;
  6. class WebpackExtension extends AbstractExtension
  7. {
  8.     /**
  9.      * @var string
  10.      */
  11.     protected $publicDir;
  12.     /**
  13.      * @var string
  14.      */
  15.     protected $manifestFile;
  16.     public function __construct(string $manifestFilestring $publicDir)
  17.     {
  18.         $this->manifestFile $manifestFile;
  19.         $this->publicDir $publicDir;
  20.     }
  21.     /**
  22.      * @return string
  23.      */
  24.     public function getName()
  25.     {
  26.         return 'fullpipe.extension.webpack';
  27.     }
  28.     /**
  29.      * {@inheritdoc}
  30.      */
  31.     public function getTokenParsers()
  32.     {
  33.         return [
  34.             new EntryTokenParserJs($this->manifestFile$this->publicDir),
  35.             new EntryTokenParserCss($this->manifestFile$this->publicDir),
  36.         ];
  37.     }
  38. }