Skip to content

Commit

Permalink
update templates to be compliant to the CS
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Jul 14, 2016
1 parent 97976ac commit f0aea21
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Template/Bake/Element/Controller/add.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $compact = ["'" . $singularName . "'"];
$<%= $singularName %> = $this-><%= $currentModelName %>->patchEntity($<%= $singularName %>, $this->request->data);
if ($this-><%= $currentModelName; %>->save($<%= $singularName %>)) {
$this->Flash->success(__('The <%= strtolower($singularHumanName) %> has been saved.'));

return $this->redirect(['action' => 'index']);
} else {
$this->Flash->error(__('The <%= strtolower($singularHumanName) %> could not be saved. Please, try again.'));
Expand Down
1 change: 1 addition & 0 deletions src/Template/Bake/Element/Controller/delete.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
} else {
$this->Flash->error(__('The <%= strtolower($singularHumanName) %> could not be deleted. Please, try again.'));
}

return $this->redirect(['action' => 'index']);
}
1 change: 1 addition & 0 deletions src/Template/Bake/Element/Controller/edit.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $compact = ["'" . $singularName . "'"];
$<%= $singularName %> = $this-><%= $currentModelName %>->patchEntity($<%= $singularName %>, $this->request->data);
if ($this-><%= $currentModelName; %>->save($<%= $singularName %>)) {
$this->Flash->success(__('The <%= strtolower($singularHumanName) %> has been saved.'));

return $this->redirect(['action' => 'index']);
} else {
$this->Flash->error(__('The <%= strtolower($singularHumanName) %> could not be saved. Please, try again.'));
Expand Down
1 change: 1 addition & 0 deletions src/Template/Bake/Element/Controller/login.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$user = $this->Auth->identify();
if ($user) {
$this->Auth->setUser($user);

return $this->redirect($this->Auth->redirectUrl());
}
$this->Flash->error(__('Invalid credentials, try again'));
Expand Down
1 change: 1 addition & 0 deletions src/Template/Bake/Model/table.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ endforeach;
<%- foreach ($rulesChecker as $field => $rule): %>
$rules->add($rules-><%= $rule['name'] %>(['<%= $field %>']<%= !empty($rule['extra']) ? ", '$rule[extra]'" : '' %>));
<%- endforeach; %>

return $rules;
}
<% endif; %>
Expand Down

0 comments on commit f0aea21

Please sign in to comment.