Skip to content

Commit

Permalink
RoutingPanel: removed $this from templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 24, 2014
1 parent 1069899 commit f314671
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public function getTab()
{
$this->analyse($this->router);
ob_start();
$request = $this->request;
require __DIR__ . '/templates/RoutingPanel.tab.phtml';
return ob_get_clean();
}
Expand All @@ -79,6 +80,10 @@ public function getTab()
public function getPanel()
{
ob_start();
$request = $this->request;
$routers = $this->routers;
$source = $this->source;
$url = $this->httpRequest->getUrl();
require __DIR__ . '/templates/RoutingPanel.panel.phtml';
return ob_get_clean();
}
Expand Down
12 changes: 6 additions & 6 deletions src/Bridges/ApplicationTracy/templates/RoutingPanel.panel.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ use Nette,

<div class="nette-RoutingPanel">
<h1>
<?php if (empty($this->request)): ?>
<?php if (empty($request)): ?>
no route
<?php else: ?>
<?php echo htmlSpecialChars($this->request->getPresenterName() . ':' . (isset($this->request->parameters[Presenter::ACTION_KEY]) ? $this->request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($this->request->parameters[Presenter::SIGNAL_KEY]) ? " {$this->request->parameters[Presenter::SIGNAL_KEY]}!" : '')) ?>
<?php echo htmlSpecialChars($request->getPresenterName() . ':' . (isset($request->parameters[Presenter::ACTION_KEY]) ? $request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($request->parameters[Presenter::SIGNAL_KEY]) ? " {$request->parameters[Presenter::SIGNAL_KEY]}!" : '')) ?>
<?php endif ?>
</h1>

<div class="tracy-inner">
<p><code><?php echo htmlSpecialChars($this->httpRequest->getUrl()) ?></code></p>
<p><code><?php echo htmlSpecialChars($url) ?></code></p>

<?php if (empty($this->routers)): ?>
<?php if (empty($routers)): ?>
<p>No routers defined.</p>

<?php else: ?>
Expand All @@ -61,7 +61,7 @@ use Nette,
</thead>

<tbody>
<?php foreach ($this->routers as $router): ?>
<?php foreach ($routers as $router): ?>
<tr class="<?php echo $router['matched'] ?>">
<td><?php echo $router['matched'] ?></td>

Expand Down Expand Up @@ -91,6 +91,6 @@ use Nette,
</table>
<?php endif ?>

<?php if ($this->source): ?><p><?php echo $this->source ?> in <?php echo Tracy\Helpers::editorLink($this->source->getFileName(), $this->source->getStartLine()) ?></p><?php endif ?>
<?php if ($source): ?><p><?php echo $source ?> in <?php echo Tracy\Helpers::editorLink($source->getFileName(), $source->getStartLine()) ?></p><?php endif ?>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ use Nette,

?>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJHSURBVDjLlZPNi81hFMc/z7137p1mTCFvNZfGSzLIWNjZKRvFRoqNhRCSYm8xS3+AxRRZ2JAFJWJHSQqTQkbEzYwIM+6Yid/znJfH4prLXShOnb6r8/nWOd8Tcs78bz0/f+KMu50y05nK/wy+uHDylbutqS5extvGcxaWqtoGDA8PZ3dnrs2srQc2Zko41UXLmLdyDW5OfvsUkUgbYGbU63UAQggdmvMzFmzZCgTi7CQmkZwdEaX0JwDgTnGbTCaE0G4zw80omhPI92lcEtkNkdgJCCHwJX7mZvNaB0A14SaYJlwTrpHsTkoFlV1nt2c3x5YYo1/vM9A/gKpxdfwyu/v3teCayKq4JEwT5EB2R6WgYmrs2bYbcUNNUVfEhIfFYy69uci+1fuRX84mkawFSxd/4nVWUopUVIykwlQxRTJBTIDA4Pp1jBZPuNW4wUAPmCqWIn29X1k4f5Ku8g9mpKCkakRLVEs1auVuauVuyqHMo8ejNCe+sWPVTkQKXCMmkeZUmUZjETF1tc6ooly+fgUVw9So1/tRN6YnZji46QghBFKKuAouERNhMlbAHZFE6e7pB+He8MMw+GGI4xtOMf1+lsl3TQ4NHf19BSlaO1DB9BfMHdX0O0iqSgiBbJkjm491hClJbA1LxCURgpPzXwAHhg63necAIi3XngXLcRU0fof8ETMljIyM5LGxMcbHxzvy/6fuXdWgt6+PWncv1e4euqo1ZmabvHs5+jn8yzufO7hiiZmuNpNBM13rbvVSpbrXJE7/BMkHtU9jFIC/AAAAAElFTkSuQmCC"
/><?php if (empty($this->request)): ?>no route<?php else: echo htmlSpecialChars($this->request->getPresenterName() . ':' . (isset($this->request->parameters[Presenter::ACTION_KEY]) ? $this->request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($this->request->parameters[Presenter::SIGNAL_KEY]) ? " {$this->request->parameters[Presenter::SIGNAL_KEY]}!" : '')); endif ?>
/><?php if (empty($request)): ?>no route<?php else: echo htmlSpecialChars($request->getPresenterName() . ':' . (isset($request->parameters[Presenter::ACTION_KEY]) ? $request->parameters[Presenter::ACTION_KEY] : Presenter::DEFAULT_ACTION) . (isset($request->parameters[Presenter::SIGNAL_KEY]) ? " {$request->parameters[Presenter::SIGNAL_KEY]}!" : '')); endif ?>

0 comments on commit f314671

Please sign in to comment.