Skip to content

Commit

Permalink
Update bake templates.
Browse files Browse the repository at this point in the history
Now using 'confirm' key in options for FormHelper::postLink()
instead of removed param $confirmMessage.
  • Loading branch information
ADmad committed Jul 5, 2014
1 parent 9d64ac6 commit 0c1b25b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Console/Templates/default/views/form.ctp
Expand Up @@ -49,7 +49,7 @@ use Cake\Utility\Inflector;
<h3><?= "<?= __('Actions'); ?>"; ?></h3>
<ul>
<?php if (strpos($action, 'add') === false): ?>
<li><?= "<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', \${$singularVar}->{$primaryKey[0]}], [], __('Are you sure you want to delete # %s?', \${$singularVar}->{$primaryKey[0]})); ?>"; ?></li>
<li><?= "<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', \${$singularVar}->{$primaryKey[0]}], ['confirm' => __('Are you sure you want to delete # %s?', \${$singularVar}->{$primaryKey[0]})]); ?>"; ?></li>
<?php endif; ?>
<li><?= "<?= \$this->Html->link(__('List " . $pluralHumanName . "'), ['action' => 'index']); ?>"; ?></li>
<?php
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Templates/default/views/index.ctp
Expand Up @@ -47,7 +47,7 @@ use Cake\Utility\Inflector;
echo "\t\t<td class=\"actions\">\n";
echo "\t\t\t<?= \$this->Html->link(__('View'), ['action' => 'view', {$pk}]); ?>\n";
echo "\t\t\t<?= \$this->Html->link(__('Edit'), ['action' => 'edit', {$pk}]); ?>\n";
echo "\t\t\t<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', {$pk}], [], __('Are you sure you want to delete # %s?', {$pk})); ?>\n";
echo "\t\t\t<?= \$this->Form->postLink(__('Delete'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # %s?', {$pk})]); ?>\n";
echo "\t\t</td>\n";
echo "\t</tr>\n";

Expand Down
4 changes: 2 additions & 2 deletions src/Console/Templates/default/views/view.ctp
Expand Up @@ -45,7 +45,7 @@ foreach ($fields as $field) {
$pk = "\${$singularVar}->{$primaryKey[0]}";

echo "\t\t<li><?= \$this->Html->link(__('Edit " . $singularHumanName ."'), ['action' => 'edit', {$pk}]); ?> </li>\n";
echo "\t\t<li><?= \$this->Form->postLink(__('Delete " . $singularHumanName . "'), ['action' => 'delete', {$pk}], [], __('Are you sure you want to delete # %s?', {$pk})); ?> </li>\n";
echo "\t\t<li><?= \$this->Form->postLink(__('Delete " . $singularHumanName . "'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # %s?', {$pk})]); ?> </li>\n";
echo "\t\t<li><?= \$this->Html->link(__('List " . $pluralHumanName . "'), ['action' => 'index']); ?> </li>\n";
echo "\t\t<li><?= \$this->Html->link(__('New " . $singularHumanName . "'), ['action' => 'add']); ?> </li>\n";

Expand Down Expand Up @@ -123,7 +123,7 @@ echo "\t\t<?php foreach (\${$singularVar}->{$details['property']} as \${$otherSi
echo "\t\t\t<td class=\"actions\">\n";
echo "\t\t\t\t<?= \$this->Html->link(__('View'), ['controller' => '{$details['controller']}', 'action' => 'view', {$otherPk}]); ?>\n";
echo "\t\t\t\t<?= \$this->Html->link(__('Edit'), ['controller' => '{$details['controller']}', 'action' => 'edit', {$otherPk}]); ?>\n";
echo "\t\t\t\t<?= \$this->Form->postLink(__('Delete'), ['controller' => '{$details['controller']}', 'action' => 'delete', {$otherPk}], [], __('Are you sure you want to delete # %s?', {$otherPk})); ?>\n";
echo "\t\t\t\t<?= \$this->Form->postLink(__('Delete'), ['controller' => '{$details['controller']}', 'action' => 'delete', {$otherPk}], ['confirm' => __('Are you sure you want to delete # %s?', {$otherPk})]); ?>\n";
echo "\t\t\t</td>\n";
echo "\t\t</tr>\n";

Expand Down

0 comments on commit 0c1b25b

Please sign in to comment.