protected function viewContent($type, $view)
    {
        $ext = pathinfo($view, PATHINFO_EXTENSION);
        $view = ($ext === '') ? $view.'.php' : $view;
        foreach ($this->paths as $path) {
            $path .= $type . DIRECTORY_SEPARATOR;
            if ($this->context()
                &&
                file_exists($path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view)
            ) {
                $viewPath = $path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view;
                break;
            }
            if (file_exists($path . $view)) {
                $viewPath = $path . $view;
                break;
            }
        }
        if (!isset($viewPath)) {
            throw new \RuntimeException('Unable to find the ' . $view);
        }
        ob_start();
        include($viewPath);
        $content = ob_get_contents();
        ob_end_clean();
        return $content;
    }
protected function viewContent($type, $view)
    {
        $ext = pathinfo($view, PATHINFO_EXTENSION);
        $view = ($ext === '') ? $view.'.php' : $view;
        foreach ($this->paths as $path) {
            $path .= $type . DIRECTORY_SEPARATOR;
            if ($this->context()
                &&
                file_exists($path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view)
            ) {
                $viewPath = $path . trim($this->context(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $view;
                break;
            }
            if (file_exists($path . $view)) {
                $viewPath = $path . $view;
                break;
            }
        }
        if (!isset($viewPath)) {
            throw new \RuntimeException('Unable to find the ' . $view);
        }
        ob_start();
        include($viewPath);
        $content = ob_get_contents();
        ob_end_clean();
        return $content;
    }
protected function viewContent ( $ type , $ view ) { $ ext = pathinfo ( $ view , PATHINFO_EXTENSION ) ; $ view = ( $ ext === '' ) ? $ view . '.php' : $ view ; foreach ( $ this -> paths as $ path ) { $ path .= $ type . DIRECTORY_SEPARATOR ; if ( $ this -> context ( ) && file_exists ( $ path . trim ( $ this -> context ( ) , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . $ view ) ) { $ viewPath = $ path . trim ( $ this -> context ( ) , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . $ view ; break ; } if ( file_exists ( $ path . $ view ) ) { $ viewPath = $ path . $ view ; break ; } } if ( ! isset ( $ viewPath ) ) { throw new \ RuntimeException ( 'Unable to find the ' . $ view ) ; } ob_start ( ) ; include ( $ viewPath ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; return $ content ; }
Render a view content

@param  string $type
@param  string $view
@return string
Render a view content