/**
  * Register any application services.
  * @return void
  */
 public function register()
 {
     $this->app->singleton('theme', function () {
         $theme = new ThemeModel();
         return $theme;
     });
     return parent::register();
 }
Esempio n. 2
0
 /**
  * Override the parent's register function
  * to add our own functionality!
  *
  * @return void
  */
 public function register()
 {
     $this->app->bind('themer', function ($app) {
         return new Themer($app);
     });
     $this->app->bind('themer.metadata', function ($app) {
         return new MetaData();
     });
     $this->registerGenerateCommand();
     parent::register();
     // $this->registerThemeViewPaths();
     $this->registered = true;
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // This is only for the template system.
     $templateIdString = '';
     $templateIdsArray = $this->app['config']->get('template.templateIds');
     if (is_array($templateIdsArray) && !empty($templateIdsArray) && !empty($_SERVER['HTTP_HOST'])) {
         $templateIdString = array_search($_SERVER['HTTP_HOST'], $templateIdsArray);
         $templateIdString .= '/';
     }
     define('TEMPLATE_ID', $templateIdString);
     //$this->package('niterain/PhpTalView', 'PhpTalView', __DIR__.'/../../');
     parent::register();
 }
Esempio n. 4
0
 public function register()
 {
     parent::register();
     $this->registerCommands();
 }
<?php

require __DIR__ . '/vendor/autoload.php';
use Illuminate\Container\Container;
use Illuminate\Events\Dispatcher;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Fluent;
use Illuminate\View\ViewServiceProvider;
$app = new Container();
$app['events'] = new Dispatcher();
$app['config'] = new Fluent();
$app['files'] = new Filesystem();
$app['config']['view.paths'] = [__DIR__ . '/views/'];
$app['config']['view.compiled'] = __DIR__ . '/compiled/';
$serviceProvider = new ViewServiceProvider($app);
$serviceProvider->register();
$serviceProvider->boot();
Facade::setFacadeApplication($app);
class_alias(View::class, 'View');
 public function register()
 {
     parent::register();
     $this->registerEnvironment();
     $this->registerBladeExtensions();
 }