Skip to content

Commit

Permalink
Highlight code suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 29, 2014
1 parent a2f92e5 commit 43b1469
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Template/Error/missing_action.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,22 @@ $this->start('file');
<strong>Error: </strong>
<?= sprintf('Create <em>%s::%s()</em> in file: %s.', h($controller), h($action), $path); ?>
</p>
<pre>
&lt;?php
namespace <?= h($namespace); ?>\Controller<?= h($prefixNs); ?>;

use <?= h($namespace); ?>\Controller\AppController;
<?php
$code = <<<PHP
<?php
namespace {$namespace}\Controller{$prefixNs};
use {$namespace}\Controller\AppController;
class <?= h($controller); ?> extends AppController {
class {$controller} extends AppController {
<strong>
public function <?= h($action); ?>() {
public function {$action}() {
}
</strong>
}
</pre>
PHP;
?>

<div class="code-dump"><?php highlight_string($code) ?></div>
<?php $this->end() ?>
2 changes: 2 additions & 0 deletions src/Template/Layout/dev_error.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ body {
margin: 0;
max-height: 100%;
}

.code-dump,
pre {
background: #fefefe;
border: 1px solid #ddd;
Expand Down

0 comments on commit 43b1469

Please sign in to comment.