Skip to content

Commit

Permalink
Consistent usage of short echo and sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrowe committed Jul 28, 2014
1 parent 168292f commit 84e4b8d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Console/Templates/default/views/form.ctp
Expand Up @@ -17,7 +17,7 @@ use Cake\Utility\Inflector;
<div class="<?= $pluralVar; ?> form">
<?= "<?= \$this->Form->create(\${$singularVar}); ?>\n"; ?>
<fieldset>
<legend><?php printf("<?= __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></legend>
<legend><?= sprintf("<?= __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName) ?></legend>
<?php
echo "\t<?php\n";
foreach ($fields as $field) {
Expand Down
4 changes: 2 additions & 2 deletions src/Template/Error/missing_cell_view.ctp
Expand Up @@ -17,11 +17,11 @@ use Cake\Utility\Inflector;
<h2>Missing Cell View</h2>
<p class="error">
<strong>Error: </strong>
<?php printf('The view for <em>%sCell</em> was not found.', h(Inflector::camelize($name))); ?>
<?= sprintf('The view for <em>%sCell</em> was not found.', h(Inflector::camelize($name))) ?>
</p>

<p>
<?php printf('Confirm you have created the file: "%s"', h($file . $this->_ext)); ?>
<?= sprintf('Confirm you have created the file: "%s"', h($file . $this->_ext)) ?>
in one of the following paths:
</p>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions src/Template/Error/missing_view.ctp
Expand Up @@ -17,11 +17,11 @@ use Cake\Utility\Inflector;
<h2>Missing View</h2>
<p class="error">
<strong>Error: </strong>
<?php printf('The view for <em>%sController::%s()</em> was not found.', h(Inflector::camelize($this->request->controller)), h($this->request->action)); ?>
<?= sprintf('The view for <em>%sController::%s()</em> was not found.', h(Inflector::camelize($this->request->controller)), h($this->request->action)) ?>
</p>

<p>
<?php printf('Confirm you have created the file: "%s"', h($file)); ?>
<?= sprintf('Confirm you have created the file: "%s"', h($file)) ?>
in one of the following paths:
</p>
<ul>
Expand All @@ -38,7 +38,7 @@ use Cake\Utility\Inflector;

<p class="notice">
<strong>Notice: </strong>
<?php printf('If you want to customize this error message, create %s', APP_DIR . DS . 'Template' . DS . 'Error' . DS . 'missing_view.ctp'); ?>
<?= sprintf('If you want to customize this error message, create %s', APP_DIR . DS . 'Template' . DS . 'Error' . DS . 'missing_view.ctp') ?>
</p>

<?= $this->element('exception_stack_trace'); ?>
6 changes: 3 additions & 3 deletions tests/test_app/TestApp/Template/Error/error400.ctp
Expand Up @@ -14,13 +14,13 @@
*/
use Cake\Core\Configure;
?>
<h2><?= $message; ?></h2>
<h2><?= $message ?></h2>
<p class="error">
<strong><?= __d('cake', 'Error'); ?>: </strong>
<?php printf(
<?= sprintf(
__d('cake', 'The requested address %s was not found on this server.'),
"<strong>'{$url}'</strong>"
); ?>
) ?>
</p>
<?php
if (Configure::read('debug')):
Expand Down

0 comments on commit 84e4b8d

Please sign in to comment.