/** * Register the View Factory. * * @return void */ public function registerFactory() { $this->app->bindShared('view', function ($app) { $resolver = $app['view.engine.resolver']; $factory = new Factory($resolver, $app['view.finder']); $factory->share('app', $app); return $factory; }); }
/** * Render the given view. * * @param string $view * @param array $data * @return \Nova\View\View */ protected function getView($view, $data) { return $this->views->make($view, $data)->render(); }
/** * Add a key / value pair to the shared view data. * * Shared view data is accessible to every view created by the application. * * @param string $key * @param mixed $value * @return View */ public function shares($key, $value) { $this->factory->share($key, $value); return $this; }