diff --git a/src/DataCollector/AnotherDataCollector.php b/src/DataCollector/AnotherDataCollector.php new file mode 100644 index 0000000..1855951 --- /dev/null +++ b/src/DataCollector/AnotherDataCollector.php @@ -0,0 +1,41 @@ +data = [ + 'method' => $request->getMethod(), + 'acceptable_content_types' => $request->getAcceptableContentTypes(), + ]; + } + + public function getMethod(): string + { + return $this->data['method']; + } + + public function getAcceptableContentTypes(): array + { + return $this->data['acceptable_content_types']; + } + + public function getSomeObject(): Data + { + // use the cloneVar() method to dump collected data in the profiler + return $this->cloneVar($this->data['method']); + } + + public static function getTemplate(): ?string + { + return 'collector/another.html.twig'; + } +} \ No newline at end of file diff --git a/templates/collector/another.html.twig b/templates/collector/another.html.twig new file mode 100644 index 0000000..da4853f --- /dev/null +++ b/templates/collector/another.html.twig @@ -0,0 +1,61 @@ +{% extends '@WebProfiler/Profiler/layout.html.twig' %} + +{# Now this breaks stuff #} +{% from 'stuff/_test.html.twig' import cavia %} + +{% block toolbar %} + {% set icon %} + {# this is the content displayed as + a panel in the toolbar #} + + {# Especially here #} +
+ {% endset %} + + {% set text %} + {# this is the content displayed when hovering the mouse over + the toolbar panel #} + + + + {% endset %} + + {# the 'link' value set to 'false' means that this panel doesn't + show a section in the web profiler #} + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false }) }} +{% endblock %} + +{% block menu %} + {# This left-hand menu appears when using the full-screen profiler. #} + + + Cavia + +{% endblock %} + +{% block panel %} + {# Optional, for showing the most details. #} +Content Type | +
---|
{{ type }} | +