Esempio n. 1
0
 /**
  * Render a widget view.
  *
  * @param  Module $module
  * @return View
  */
 protected function renderWidget($module)
 {
     // Resolve view component.
     $view = $this->app->make('view');
     // Add a module view namespace for this widget.
     $view->addNamespace('anbu_widget', $module->getPath());
     // Extract template name.
     $template = $module->getWidget();
     // Return rendered template view.
     return $view->make("anbu_widget::{$template}", $module->getData());
 }
Esempio n. 2
0
 /**
  * Render the child view for a module.
  *
  * @param  Module $module
  * @return View
  */
 protected function renderModule(Module $module)
 {
     // Add a module view namespace for this request.
     View::addNamespace('anbu_module', $module->getPath());
     // Execute live module hook.
     $module->live();
     // Extract template name.
     $template = $module->getTemplate();
     // Return rendered template view.
     return View::make("anbu_module::{$template}", $module->getData());
 }