Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Sep 4, 2014
1 parent 7dc787a commit a81ff20
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/View/Theme/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,9 @@ public function boot()
$this->dispatcher->fire("orchestra.theme.resolving", array($this, $this->app));

$viewFinder = $this->app['view.finder'];
$themePath = $this->getThemePath();
$autoload = $this->getThemeAutoloadFiles($themePath);

$this->setViewPaths($viewFinder);

foreach ($autoload as $file) {
$file = ltrim($file, '/');
$this->files->requireOnce("{$themePath}/{$file}");
}
$this->loadThemeStarterFiles();

$this->dispatcher->fire("orchestra.theme.boot: {$this->theme}");

Expand Down Expand Up @@ -242,4 +236,20 @@ protected function setViewPaths(FileViewFinder $viewFinder)
$viewFinder->setPaths(array_merge($themePaths, $viewFinder->getPaths()));
}
}

/**
* Load theme starter files.
*
* @return void
*/
protected function loadThemeStarterFiles()
{
$themePath = $this->getThemePath();
$autoload = $this->getThemeAutoloadFiles($themePath);

foreach ($autoload as $file) {
$file = ltrim($file, '/');
$this->files->requireOnce("{$themePath}/{$file}");
}
}
}

0 comments on commit a81ff20

Please sign in to comment.