예제 #1
0
 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();
 }
예제 #2
0
 /**
  * **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);
 }
예제 #3
0
 /**
  * MarkdownView constructor.
  *
  * @param array $settings
  */
 public function __construct($settings = [])
 {
     $settings = $settings ?: config('view.markdown.defaults');
     $this->configure($settings);
     parent::__construct($settings);
 }