Refactoring: added controlled middleware and changed response class

This commit is contained in:
Frederic Guillot
2016-05-15 18:31:47 -04:00
parent 108e867605
commit 67b8361649
105 changed files with 1586 additions and 1147 deletions

View File

@@ -8,12 +8,14 @@ namespace Kanboard\Controller;
* @package controller
* @author Frederic Guillot
*/
class Currency extends Base
class Currency extends BaseController
{
/**
* Display all currency rates and form
*
* @access public
* @param array $values
* @param array $errors
*/
public function index(array $values = array(), array $errors = array())
{
@@ -40,13 +42,13 @@ class Currency extends Base
if ($valid) {
if ($this->currency->create($values['currency'], $values['rate'])) {
$this->flash->success(t('The currency rate have been added successfully.'));
$this->response->redirect($this->helper->url->to('currency', 'index'));
return $this->response->redirect($this->helper->url->to('currency', 'index'));
} else {
$this->flash->failure(t('Unable to add this currency rate.'));
}
}
$this->index($values, $errors);
return $this->index($values, $errors);
}
/**