public function __construct(TwigViewConfigurationInterface $context) { $this->context = $context; $this->defaults = $context->settings(); $this->templatePaths = $this->defaults['filesystem']; $this->events = $context->events(); parent::__construct($context); $this->configure(); }
/** * **Make a new View.** * * Note: __This method is used internally to make views.__ * * The purpose for this is to allow making changes to the View * object before rendering. ie: * * $view = app('blade.view')->makeView('test',['data'=>'some data']); * $view->nest('key','view',['test' => 'test data']); * return $view->render(); * * @param $view * @param array $data * * @return View */ public function makeView($view, array $data) { $data = parent::collectScope($data); return $this->context->factory()->make($view, $data); }
/** * MarkdownView constructor. * * @param array $settings */ public function __construct($settings = []) { $settings = $settings ?: config('view.markdown.defaults'); $this->configure($settings); parent::__construct($settings); }