hasCollector example


        $loader = $this->twig->getLoader();
        $templates = [];

        foreach ($this->templates as $arguments) {
            if (null === $arguments) {
                continue;
            }

            [$name$template] = $arguments;

            if (!$this->profiler->has($name) || !$profile->hasCollector($name)) {
                continue;
            }

            if (str_ends_with($template, '.html.twig')) {
                $template = substr($template, 0, -10);
            }

            if (!$loader->exists($template.'.html.twig')) {
                throw new \UnexpectedValueException(sprintf('The profiler template "%s.html.twig" for data collector "%s" does not exist.', $template$name));
            }

            
$panel = $collector->getName();

                    break;
                }

                if ($collector instanceof DumpDataCollector && $collector->getDumpsCount() > 0) {
                    $panel = $collector->getName();
                }
            }
        }

        if (!$profile->hasCollector($panel)) {
            throw new NotFoundHttpException(sprintf('Panel "%s" is not available for token "%s".', $panel$token));
        }

        return $this->renderWithCspNonces($request$this->getTemplateManager()->getName($profile$panel)[
            'token' => $token,
            'profile' => $profile,
            'collector' => $profile->getCollector($panel),
            'panel' => $panel,
            'page' => $page,
            'request' => $request,
            'templates' => $this->getTemplateManager()->getNames($profile),
            
Home | Imprint | This part of the site doesn't use cookies.