Skip to content

Commit

Permalink
Update bladex.php
Browse files Browse the repository at this point in the history
  • Loading branch information
israel-nogueira committed May 18, 2023
1 parent d9c81d3 commit 8a471e0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/bladex.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,28 @@ class bladex implements FactoryContract
*/
private $compiler;

public function __construct($viewPaths, string $cachePath, ContainerInterface $container = null)
public function __construct($viewPaths=null, string $cachePath=null, ContainerInterface $container = null)
{
$this->container = $container ?: new Container;

$this->setupContainer((array) $viewPaths, $cachePath);
$VIEWS = $viewPaths?? realpath(__DIR__.'/../../../..').'/views';
$CACHE = $cachePath?? realpath(__DIR__.'/../../../..').'/cache';

$this->setupContainer((array) $VIEWS, $CACHE);
(new ViewServiceProvider($this->container))->register();

$this->factory = $this->container->get('view');
$this->compiler = $this->container->get('blade.compiler');
}


static public function view(string $view, array $data = [], array $mergeData = [])
{
$instancia = new self();
return $instancia->make($view, $data, $mergeData);
}


public function render(string $view, array $data = [], array $mergeData = []): string
{
return $this->make($view, $data, $mergeData)->render();
Expand Down

0 comments on commit 8a471e0

Please sign in to comment.