Esempio n. 1
0
 /**
  * Render the homepage view for displaying.
  *
  * @param  string $name
  * @return string
  */
 public function render($name, $subname = 'Home.Content')
 {
     if ($this->cache->has('home.content')) {
         $content = $this->cache->get('home.content');
     } else {
         $slides = App::make('Lib\\Slides\\SlideRepository')->get();
         $news = App::make('Lib\\News\\NewsRepository')->latest(8);
         $content = $this->view->make($subname)->with('slides', $slides)->with('news', $news)->with('categories', $this->getCategories())->render();
         $this->cache->put('home.content', $content, 2880);
     }
     return $this->view->make($name)->with('content', $content);
 }
Esempio n. 2
0
 /**
  * Add a view instance to the view data.
  *
  * @param  string  $key
  * @param  string  $view
  * @param  array   $data
  * @return Illuminate\View\View
  */
 public function nest($key, $view, array $data = array())
 {
     return $this->with($key, $this->environment->make($view, $data));
 }