mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +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();
|
$this-><?php echo $currentModelName; ?>->create();
|
||||||
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
|
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?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'));
|
return $this->redirect(array('action' => 'index'));
|
||||||
} else {
|
} 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: ?>
|
<?php else: ?>
|
||||||
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -94,10 +94,10 @@
|
||||||
if ($this->request->is(array('post', 'put'))) {
|
if ($this->request->is(array('post', 'put'))) {
|
||||||
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
|
if ($this-><?php echo $currentModelName; ?>->save($this->request->data)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?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'));
|
return $this->redirect(array('action' => 'index'));
|
||||||
} else {
|
} 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: ?>
|
<?php else: ?>
|
||||||
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
return $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -138,9 +138,9 @@
|
||||||
$this->request->allowMethod('post', 'delete');
|
$this->request->allowMethod('post', 'delete');
|
||||||
if ($this-><?php echo $currentModelName; ?>->delete()) {
|
if ($this-><?php echo $currentModelName; ?>->delete()) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?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 {
|
} 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'));
|
return $this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue