Skip to content
Permalink
Browse files

Updating deprecated SessionComponent::setFlash calls to FlashComponen…

…t magic calls.
  • Loading branch information...
mattmemmesheimer committed Aug 16, 2015
1 parent 604cb0e commit d3cf879195a52b45b27d18674edde0d3c55c615c
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Console/Templates/default/actions/controller_actions.ctp
@@ -53,10 +53,10 @@
$this-><?php echo $currentModelName; ?>->create();
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'));
$this->Flash->success(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
$this->Flash->error(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
<?php else: ?>
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
<?php endif; ?>
@@ -94,10 +94,10 @@
if ($this->request->is(array('post', 'put'))) {
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'));
$this->Flash->success(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
$this->Flash->error(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.'));
<?php else: ?>
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
<?php endif; ?>
@@ -138,9 +138,9 @@
$this->request->allowMethod('post', 'delete');
if ($this-><?php echo $currentModelName; ?>->delete()) {
<?php if ($wannaUseSession): ?>
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been deleted.'));
$this->Flash->success(__('The <?php echo strtolower($singularHumanName); ?> has been deleted.'));
} else {
$this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be deleted. Please, try again.'));
$this->Flash->error(__('The <?php echo strtolower($singularHumanName); ?> could not be deleted. Please, try again.'));
}
return $this->redirect(array('action' => 'index'));
<?php else: ?>

0 comments on commit d3cf879

Please sign in to comment.
You can’t perform that action at this time.