/** * Fetch the correct controller, check if the action exist and call the action, it also verify the access right */ public function init() { $controller = $this->getController(); if (array_key_exists($controller, $this->controllers)) { $action = $this->getAction(); $args = Controller::bindArgs($controller, $action, explode("/", $this->getArgs())); $this->callAction($this->controllers[$controller], $this->getAction(), $args); } else { $this->callAction(Dispatcher::DEFAULT_CONTROLLER); } }
public function postAction($args = []) { $poster = new ItemSetPoster(); $poster->parse(); $itemSet = $poster->getItemSet(); if (!empty($itemSet->getBlocks())) { $itemSet->save(); header('Location: ' . Controller::generateURL('itemset', 'view', ['id' => $itemSet->getId()])); } else { header('Location: ' . Controller::generateURL('itemset', 'create')); } }