ManaPHP\Debugger::output PHP Method

output() public method

public output ( string $template = 'Default' ) : array | string
$template string
return array | string
    public function output($template = 'Default')
    {
        $data = [];
        $data['basic'] = $this->_getBasic();
        $data['dump'] = $this->_dump;
        $data['logger'] = ['log' => $this->_log, 'levels' => $this->logger->getLevels(), 'level' => 5];
        $data['sql'] = ['prepared' => $this->_sql_prepared, 'executed' => $this->_sql_executed, 'count' => $this->_sql_count];
        /** @noinspection ImplicitMagicMethodCallInspection */
        $data['configure'] = isset($this->configure) ? $this->configure->__debugInfo() : [];
        $data['view'] = $this->_view;
        $data['exception'] = $this->_exception;
        $data['warnings'] = $this->_warnings;
        $data['components'] = [];
        /** @noinspection ImplicitMagicMethodCallInspection */
        /** @noinspection ForeachSourceInspection */
        foreach ($this->_dependencyInjector->__debugInfo()['_sharedInstances'] as $k => $v) {
            if (method_exists($v, 'dump')) {
                $data['components'][] = ['name' => $k, 'class' => get_class($v), 'properties' => $v->dump()];
            } else {
                $data['components'][] = ['name' => '', 'class' => get_class($v)];
            }
        }
        if (!$template) {
            return $data;
        }
        $file = Text::contains($template, '/') ? $template : $this->alias->resolve('@manaphp/Debugger/Template/' . $template);
        return $this->renderer->render($file, ['data' => $data], false);
    }