Example #1
0
 /**
  * Apply the data to configure the theme
  */
 public function run()
 {
     $data = $this->getData();
     // If blade is enabled, initialize it
     if ($this->isBladeEnabled()) {
         $bladeConfig = $data['blade'];
         // Setup blade and paths
         $viewsPath = $bladeConfig['paths']['views'];
         $cachePath = $bladeConfig['paths']['cache'];
         $blade = new Blade($viewsPath, $cachePath);
         // Extend blade
         /** @var \Illuminate\View\Compilers\BladeCompiler $compiler */
         $compiler = $blade->getCompiler();
         $extensions = array(new WordPressLoopExtension(), new WordPressQueryExtension(), new WordPressShortcodeExtension());
         /** @var Extension $ext */
         foreach ($extensions as $ext) {
             $ext->register($compiler);
         }
         // Set the blade engine in the facade
         Baobab::setBlade($blade);
     }
 }