/**
  * Once the provided has booted, we can now look at configuration and see if there's
  * any paths defined to automatically load and register the required themes.
  */
 protected function bootThemes()
 {
     $paths = $this->app['config']->get('stylist.paths', []);
     foreach ($paths as $path) {
         $themePaths = Stylist::discover($path);
         Stylist::registerPaths($themePaths);
     }
     $theme = $this->app['config']->get('stylist.activate', null);
     if (!is_null($theme)) {
         Stylist::activate($theme);
     }
 }
Exemple #2
0
 public function testMultiplePathRegistrations()
 {
     $stylist = new Stylist(new Loader(), $this->app);
     $paths = $stylist->discover(__DIR__ . '/../Stubs');
     $stylist->registerPaths($paths);
     $stylist->activate($stylist->get('Child theme'));
     $view = $this->app->make('view');
     $this->assertEquals('Parent theme', $stylist->get('Parent theme')->getName());
     $this->assertEquals('Child theme', $stylist->get('Child theme')->getName());
     $this->assertTrue($view->exists('partials.menu'));
     // should pull this from the child theme
     $this->assertTrue($view->exists('layouts.application'));
     // should pull this from the parent theme
 }