Exemplo n.º 1
0
 /**
  * Create a new view instance.
  *
  * @param LaravelFactory $environment
  * @param \Illuminate\View\Engines\EngineInterface $engine
  * @param \Illuminate\Translation\Translator $translator
  * @param string $view
  * @param string $path
  * @param array $data
  * @param Store $session
  * @return \Jgallred\Simplemessage\View\View
  */
 public function __construct(LaravelFactory $environment, EngineInterface $engine, Translator $translator, $view, $path, $data = array(), Store $session = null)
 {
     parent::__construct($environment, $engine, $view, $path, $data);
     $this->translator = $translator;
     // If a session driver has been specified, we will bind an instance of the
     // message container to every view. If a container instance
     // exists in the session, we will use that instance.
     if (!isset($this->data[$this->messages_key])) {
         if ($session && $session->isStarted() and $session->has($this->messages_key)) {
             $this->data[$this->messages_key] = $session->get($this->messages_key);
         } else {
             $this->data[$this->messages_key] = new TypedMessages();
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Create a new view instance.
  *
  * @param  \Illuminate\View\Factory  $factory
  * @param  \Illuminate\View\Compilers\EngineInterface  $engine
  * @param  string  $view
  * @param  string  $path
  * @param  array   $data
  * @return void
  */
 public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = array(), Shortcode $shortcode)
 {
     parent::__construct($factory, $engine, $view, $path, $data);
     $this->shortcode = $shortcode;
 }