Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
visavi committed Apr 3, 2019
1 parent abafd93 commit 9e47a90
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
25 changes: 20 additions & 5 deletions app/bootstrap.php
Expand Up @@ -3,6 +3,8 @@
use Dotenv\Dotenv;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\View;
use Jenssegers\Blade\Blade;
use Whoops\Handler\PlainTextHandler;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
Expand Down Expand Up @@ -61,19 +63,32 @@
$db::connection()->enableQueryLog();


/*use Illuminate\Container\Container;
use Illuminate\Container\Container;
use Illuminate\Support\Facades\Facade;
use Illuminate\Translation\Translator;*/
use Illuminate\Translation\Translator;
/**
* Setup a new app instance container
*
* @var Illuminate\Container\Container
*/
/*$app = new Container();
$app->singleton('app', Container::class);*/
$app = new Container();
$app->singleton('app', Container::class);


$app->singleton('view', static function () {
$view = new Blade([
HOME . '/themes/' . setting('themes') . '/views',
RESOURCES . '/views',
HOME . '/themes',
], STORAGE . '/caches');

$view->compiler()->withoutDoubleEncoding();

return $view;
});
/**
* Set $app as FacadeApplication handler
*/
/*Facade::setFacadeApplication($app);*/
Facade::setFacadeApplication($app);


10 changes: 2 additions & 8 deletions app/helpers.php
Expand Up @@ -34,6 +34,7 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
use Illuminate\Translation\FileLoader;
use Illuminate\Translation\Translator;
Expand Down Expand Up @@ -1607,16 +1608,9 @@ function moduleNamespace($service, $key): void
*/
function view($view, array $params = []): string
{
$blade = new Blade([
HOME . '/themes/' . setting('themes') . '/views',
RESOURCES . '/views',
HOME . '/themes',
], STORAGE . '/caches');

$blade->compiler()->withoutDoubleEncoding();
moduleNamespace($blade, $view);

return $blade->render($view, $params);
return View::make($view, $params)->render();
}

/**
Expand Down

0 comments on commit 9e47a90

Please sign in to comment.