public function getHtmlCallGraph()
 {
     $dumper = new \Twig_Profiler_Dumper_Html();
     $dump = $dumper->dump($this->getProfile());
     // needed to remove the hardcoded CSS styles
     $dump = str_replace(array('<span style="background-color: #ffd">', '<span style="color: #d44">', '<span style="background-color: #dfd">'), array('<span class="status-warning">', '<span class="status-error">', '<span class="status-success">'), $dump);
     return new \Twig_Markup($dump, 'UTF-8');
 }
Example #2
0
    public function testDump()
    {
        $dumper = new Twig_Profiler_Dumper_Html();
        $this->assertStringMatchesFormat(<<<EOF
<pre>main
└ <span style="background-color: #ffd">index.twig</span> <span style="color: #d44">%d.%dms/%d%</span>
  └ embedded.twig::block(<span style="background-color: #dfd">body</span>)
  └ <span style="background-color: #ffd">embedded.twig</span>
  │ └ <span style="background-color: #ffd">included.twig</span>
  └ index.twig::macro(<span style="background-color: #ddf">foo</span>)
  └ <span style="background-color: #ffd">embedded.twig</span>
    └ <span style="background-color: #ffd">included.twig</span>
</pre>
EOF
, $dumper->dump($this->getProfile()));
    }
Example #3
0
 public function getHtmlCallGraph()
 {
     $dumper = new \Twig_Profiler_Dumper_Html();
     return new \Twig_Markup($dumper->dump($this->getProfile()), 'UTF-8');
 }