src/Widget.php
public function render()
    {
        if ($this->enable == false)
        {
            return '';
        }

        $widgetDir = $this->config->get('theme.containerDir.widget');

        $path = $this->theme->getThemeNamespace($widgetDir.'.'.$this->template);

        // If not found in theme widgets directory, try to watch in views/widgets again.
        if ($this->watch === true and ! $this->view->exists($path))
        {
            $path = $widgetDir.'.'.$this->template;
        }

        // Error file not exists.
        if ( ! $this->view->exists($path))
        {
            throw new UnknownWidgetFileException("Widget view [$this->template] not found.");
        }

        $widget = $this->view->make($path, $this->data)->render();

        return $widget;
    }
public function render()
    {
        if ($this->enable == false)
        {
            return '';
        }

        $widgetDir = $this->config->get('theme.containerDir.widget');

        $path = $this->theme->getThemeNamespace($widgetDir.'.'.$this->template);

        // If not found in theme widgets directory, try to watch in views/widgets again.
        if ($this->watch === true and ! $this->view->exists($path))
        {
            $path = $widgetDir.'.'.$this->template;
        }

        // Error file not exists.
        if ( ! $this->view->exists($path))
        {
            throw new UnknownWidgetFileException("Widget view [$this->template] not found.");
        }

        $widget = $this->view->make($path, $this->data)->render();

        return $widget;
    }
public function render ( ) { if ( $ this -> enable == false ) { return '' ; } $ widgetDir = $ this -> config -> get ( 'theme.containerDir.widget' ) ; $ path = $ this -> theme -> getThemeNamespace ( $ widgetDir . '.' . $ this -> template ) ; // If not found in theme widgets directory, try to watch in views/widgets again. if ( $ this -> watch === true and ! $ this -> view -> exists ( $ path ) ) { $ path = $ widgetDir . '.' . $ this -> template ; } // Error file not exists. if ( ! $ this -> view -> exists ( $ path ) ) { throw new UnknownWidgetFileException ( "Widget view [$this->template] not found." ) ; } $ widget = $ this -> view -> make ( $ path , $ this -> data ) -> render ( ) ; return $ widget ; }
Render widget to HTML.

@throws UnknownWidgetFileException
@return string
Render widget to HTML .