Barryvdh\Debugbar\DataCollector\ViewCollector::addView PHP Method

addView() public method

Add a View instance to the Collector
public addView ( Illuminate\View\View $view )
$view Illuminate\View\View
    public function addView(View $view)
    {
        $name = $view->getName();
        $path = $view->getPath();
        if (!is_object($path)) {
            if ($path) {
                $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
            }
            if (substr($path, -10) == '.blade.php') {
                $type = 'blade';
            } else {
                $type = pathinfo($path, PATHINFO_EXTENSION);
            }
        } else {
            $type = get_class($view);
            $path = '';
        }
        if (!$this->collect_data) {
            $params = array_keys($view->getData());
        } else {
            $data = [];
            foreach ($view->getData() as $key => $value) {
                $data[$key] = $this->exporter->exportValue($value);
            }
            $params = $data;
        }
        $this->templates[] = ['name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type];
    }