mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Updating deprecated SessionComponent::setFlash calls to FlashComponent magic calls.
This commit is contained in:
parent
604cb0e48b
commit
d3cf879195
1 changed files with 6 additions and 6 deletions
|
@ -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: ?>
|
||||
|
|
Loading…
Add table
Reference in a new issue