Skip to content

Commit

Permalink
Remove id property from bake template
Browse files Browse the repository at this point in the history
  • Loading branch information
bancer committed Oct 31, 2018
1 parent d8d6502 commit 58ebf6a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Expand Up @@ -131,12 +131,11 @@
* @return void
*/
public function <?php echo $admin; ?>delete($id = null) {
$this-><?php echo $currentModelName; ?>->id = $id;
if (!$this-><?php echo $currentModelName; ?>->exists($id)) {
throw new NotFoundException(__('Invalid <?php echo strtolower($singularHumanName); ?>'));
}
$this->request->allowMethod('post', 'delete');
if ($this-><?php echo $currentModelName; ?>->delete()) {
if ($this-><?php echo $currentModelName; ?>->delete($id)) {
<?php if ($wannaUseSession): ?>
$this->Flash->success(__('The <?php echo strtolower($singularHumanName); ?> has been deleted.'));
} else {
Expand Down
Expand Up @@ -77,12 +77,11 @@
* @return void
*/
public function delete($id = null) {
$this->BakeArticle->id = $id;
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
$this->request->allowMethod('post', 'delete');
if ($this->BakeArticle->delete()) {
if ($this->BakeArticle->delete($id)) {
$this->Flash->success(__('The bake article has been deleted.'));
} else {
$this->Flash->error(__('The bake article could not be deleted. Please, try again.'));
Expand Down
Expand Up @@ -71,12 +71,11 @@
* @return void
*/
public function delete($id = null) {
$this->BakeArticle->id = $id;
if (!$this->BakeArticle->exists($id)) {
throw new NotFoundException(__('Invalid bake article'));
}
$this->request->allowMethod('post', 'delete');
if ($this->BakeArticle->delete()) {
if ($this->BakeArticle->delete($id)) {
return $this->flash(__('The bake article has been deleted.'), array('action' => 'index'));
} else {
return $this->flash(__('The bake article could not be deleted. Please, try again.'), array('action' => 'index'));
Expand Down

0 comments on commit 58ebf6a

Please sign in to comment.