/** * Get the current action * REMARK: You should not use this method from your code, but it has to be public so we can access it later on in the core-code * * @return string */ public function getAction() { // no action specified? if ($this->action === null) { // get first parameter $actionParameter = $this->URL->getParameter(0); // unknown action and not provided in URL if ($actionParameter === null) { $this->setAction($this->config->getDefaultAction()); } else { // loop possible actions foreach ($this->config->getPossibleActions() as $actionName) { // get action that should be passed as parameter $actionURL = FL::act(SpoonFilter::toCamelCase($actionName)); // the action is the requested one if ($actionURL == $actionParameter) { // set action $this->setAction($actionName); // stop the loop break; } } } } // return return $this->action; }