TODO

@param $view View
@return array|string
435506
public function getStylesheets($view = null)
    {
        if($view === null) {
            $view = $this;
        }
        $result = '';
        foreach ($view->stylesheetMedia as $css) {
            $result .= $css->getBrowserCode() . "\n";
        }
        $view->stylesheetMedia = array();
        return $result;
    }
821616
protected function renderView(array $view)
    {
        foreach ($view as $key => $element) {
            if (empty($element['value'])) {
                $view[$key] = '';
                continue;
            }

            if (!empty($element['html'])) {
                $attributes = $this->renderAttributes($element['html_attributes']);
                $prefix = '<' . $element['html_tag'] . ' ' . $attributes . '>';
                $suffix = '</' . $element['html_tag'] . '>';
                $value = htmlspecialchars($element['value'], ENT_QUOTES, 'UTF-8');
                $view[$key] = $prefix . $value . $suffix;
            } else {
                $view[$key] = strip_tags($element['value']);
            }
        }

        return $view;
    }
1350406
public function findView($view)
    {
        $file = $this->basePath("app/View/$view.php");
        if($this->findFile($file)) {
            return $file;
        }
        else {
            throw new Exception($file." View file is missing.");
            exit;
        }
    }
1084897
public function compose(View $view)
    {
        if ($this->overwriteDisabled($view)) {
            return $view;
        }

        $this->currentPath = collect(explode('/views/', $view->getPath()))->last();

        if (\View::exists($this->getNewView())) {
            $view->setPath($this->getNewPath());
        }

        return $view;
    }
245611
public function render($view = '')
    {
        // Check for existing crumbs items
        if (!$this->hasItems()) {
            return '';
        }

        // Check for custom view
        if (!$view) {
            $view = $this->config->get('crumbs.crumbs_view');
        }

        return view($view, ['crumbs' => $this->getCrumbs()])->render();
    }
109680
public function view($view = null)
    {
        if (empty($view)) {
            return $this->getConfig('view') ?: $this->_request()->getParam('action');
        }

        return $this->setConfig('view', $view);
    }
1143899
public function render(string $view = '', array $variables = []): string
    {
        if (!empty($view)) {
            $this->setView($view);
        }
        $this->assign($variables);
        $content = $this->renderView();
        if (empty($this->layout)) {
            return $content;
        }
        return $this->renderLayout($content);
    }
56057
public function renderViewElement(View $view): ?string
    {
        if (empty($this->viewElement)) {
            return null;
        }

        return call_user_func_array([$view, 'element'], $this->viewElement);
    }
418122
private function getDataFromView(View $view)
    {
        $form = $this->getFormFromView($view);

        if (false === $form) {
            return $view->getData();
        }

        return $form;
    }
547501
protected function extension( $view ) {
		$extensions = $this->extensions();

		// Return if a valid extension exists in the template string.
		$ext_reg = '/(' . implode( '|', $extensions ) . ')+$/';
		if ( preg_match( $ext_reg, $view ) ) {
			return $template;
		}

		// Add extension to template string if it don't exists.
		return substr( $view, -strlen( $extensions[0] ) ) === $extensions[0]
			? $view : $view . $extensions[0];
	}
509428
private function getValue($data, $view)
    {
        if (is_scalar($view)) {
            return false;
        }

        if (is_array($view) || $view instanceof ArrayAccess) {
            if (! isset($view[$data])) {
                return false;
            }

            return $view[$data];
        }

        if (is_object($view)) {
            if (! isset($view->{$data})) {
                return false;
            }

            return $view->{$data};
        }

        return false;
    }
764597
public static function view(string $view, array $data = [])
  {
    $global = Self::$variables::get();
    $data = array_merge($global, $data);

    return Self::$view->view($view, $data);
  }
312782
public function getExtraTemplates($view)
    {
        if (empty($this->extraTemplates[$view])) {
            $this->extraTemplates[$view] = [];
        }

        return $this->extraTemplates[$view];
    }
810526
function viewResult( $view = '' )
    {
        if ( $view == '' )
            $view = $this->currentView();
        if ( isset( $this->ViewResult[$view] ) )
        {
            return $this->ViewResult[$view];
        }
        return null;
    }
1311646
public function view($view = null)
    {
        if (null === $view) {
            return $this->view;
        }

        $this->view = $view;

        return $this;
    }
328362
protected function renderView($view, $data)
    {
        return $view instanceof Htmlable
                        ? $view->toHtml()
                        : $this->views->make($view, $data)->render();
    }
917396
protected function initViewVars($view)
    {
        $view->set('controller', $this->getName());
        $view->set('action', $this->getAction());

        if (method_exists($view, 'setRequest')) {
            $view->setRequest($this->getRequest());
        }

        return $view;
    }