function execute($caveID, $caves) { // create View $view = new Suggestions_Index_View($_SESSION['player']->language, $_SESSION['player']->template); // create Model $model = new Suggestions_Model(); if ($this->error) { $view->setError($this->error); } return array($view->getTitle(), $view->getContent($model->getCount())); }
function execute($caveID, $caves) { // create View $view = new Suggestions_Index_View($_SESSION['player']->language, $_SESSION['player']->template); // create Model $model = new Suggestions_Model(); foreach ($_POST as $key => $val) { if (strpos($key, "suggestion") !== FALSE) { $model->addSuggestion($val); } } if ($this->error) { $view->setError($this->error); } return array($view->getTitle(), $view->getContent($model->getCount())); }