Skip to content

Commit

Permalink
Merge pull request #22 from eschalks/develop-viewcomposer
Browse files Browse the repository at this point in the history
Pass service container to SmartyFactory.
  • Loading branch information
ytake committed Mar 29, 2015
2 parents d0d9f22 + 51b20e8 commit 813d570
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Smarty/SmartyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ public function register()

$this->app['view'] = $this->app->share(
function ($app) {
return new SmartyFactory(
$factory = new SmartyFactory(
$app['view.engine.resolver'],
$app['view.finder'],
$app['events'],
new Smarty,
$this->app['config']
);

// Pass the container to the factory so it can be used to resolve view composers.
$factory->setContainer($app);

return $factory;
}
);

Expand Down

0 comments on commit 813d570

Please sign in to comment.