Skip to content

Instantly share code, notes, and snippets.

@0xMatt
Last active August 29, 2015 14:06
Show Gist options
  • Save 0xMatt/12feaafd5101917b2924 to your computer and use it in GitHub Desktop.
Save 0xMatt/12feaafd5101917b2924 to your computer and use it in GitHub Desktop.
<?php
namespace LaravelCms\Theme;
class Theme
{
/**
* Theme constructor
*
* @return void
* @access public
*/
public function __construct()
{
\View::addNamespace('theme', base_path('themes') . '/default');
}
}
<?php
namespace LaravelCms\Theme;
class ThemeServiceProvider extends \Illuminate\Support\ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->bind('theme', function ()
{
return new Theme();
});
$this->app->singleton('theme.crumbs', function ()
{
return new Breadcrumb();
});
$this->app->singleton('theme.menu', function ()
{
return new Menu();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment